I have the following code, validation works fine, but it doesnt submit
jQuery("#form_driver").validate({
submitHandler: function(form) {
//check if email exists
jQuery.ajax({
type: "POST",
url: "checkmail.php",
data: ({
email: jQuery("#email").val()
}),
cache: false,
success: function(data)
{
if(data == 0) {
alert("Email doesnt exist");
return false;
}else if (data==1){
alert("The Email is already linked to your location!");
return false;
}else if (data==2){
jQuery("#form_driver").submit();
return true;
}
}
});
}
});
Unbelievable what it outputs to the console, Its driving me crazy, it iterates forever, I had to stop it manually