How to check that unobtrusive checks have been checked in jquery function?

I have a four-margin form. I applied some unobtrusive checks to 3 of them. I want that when all unobtrusive checks have been completed, the jquery function is called, but there I defined an event onsubmitin the form, so that every time it first goes to this jquery function and performs all the steps, it shows that the unobtrusive check messages for corresponding text fields.

But I want to follow all the steps of the jquery function if the form passes an unobtrusive check.

Is there a way to verify that all unobtrusive checks have been completed?

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; }
}
}   
+5
1

, :

$('#formId').submit(function() {
    if (!$(this).valid()) {
        // validation failed => here you can call your function or whatever
        return false;
    } else {
        // the form is valid => you could perform some other action if you will
    }
});
+10

All Articles