I have a form with four fields. I have applied some unobtrusive validations to 3 of them.
I want that when all unobtrusive validation have been performed then a jquery function is called, but there I have defined an onsubmit
event on the form so that every time it first goes to that jquery function and perform all the steps then shows that the unobtrusive validation messages for the respective text boxes.
But I want to perform all steps of the jquery function if the form has passed the unobtrusive validation.
Is there a way to check that all unobtrusive validation has been performed?
This is my jquery code:
function submitDetails()
{
var check = $('#flag').val();
if (check == 1)
{
return true;
}
else {
var birthDate = ($('#BirthDate').val()).split('/');
var graduationDate = ($('#GraduationDate').val()).split('/');
var stdate = birthDate[2] + birthDate[1] + birthDate[0];
var endate = graduationDate[2] + graduationDate[1] + graduationDate[0];
if (($('#LastName').val() == "") || (parseInt(endate) < parseInt(stdate)))
{
$('#Window').data('tWindow').center().open();
return false;
}
else { return true; }
}
}