0
I need to do a validation on the start date and end date...
So that the end date may not be less than the start date, but as I started messing with javascript less than two weeks ago I’m hitting myself a little.
It would be this case below:
So much for DataInicioCurso
and DataFimCurso
how much to DataInicioDisciplina
and DataFimDisciplina
.
Could I get a validation around here? Thanks in advance!
function PreencherDadosTurma(data) {
var turma = data;
turma.IdInstituicaoDeEnsino = jq.IdInstituicaoDeEnsino.val();
turma.InstituicaoDeEnsino.IdRedeOfertante = jq.idRedeOfertante.val();
turma.IdCurso = jq.IdCurso.val();
turma.Descricao = jq.Descricao.val();
turma.QtdEstudante = jq.QtdEstudante.val().ToInt32();
turma.DataInicioCurso = jq.DataInicioCurso.val();
turma.DataFimCurso = jq.DataFimCurso.val();
turma.DataInicioDisciplina = jq.DataInicioDisciplina.val();
turma.DataFimDisciplina = jq.DataFimDisciplina.val();
turma.EmpreendedorismoAplicado = jq.EmpreendedorismoAplicadoSim.prop('checked') ? jq.EmpreendedorismoAplicadoSim.val() : jq.EmpreendedorismoAplicadoNao.val();
turma.IdTurma = jq.IdTurma.val().ToInt32();
return turma;
}
Friend, look for the momentJs library, it is magical!
– RBoschini
Hello, you can use Jqueryvalidation. http://jqueryvalidation.org/. and an example of how it uses http://stackoverflow.com/questions/19773931/validation-date-input-min-and-max-value
– PauloHDSousa
You can use the validation of the . net itself, I think it is better if you want I can make an answer.
– Diego Filipe Pedro Santos
@Diegofilipepedrosantos I want yes, please :)
– Mariane Ribeiro
@Marianeribeiro came to look managed to do something?
– Diego Filipe Pedro Santos
@Diegofilipepedrosantos Hello Diego, yes I did and I did! Thank you very much. Thank you!
– Mariane Ribeiro