我有以下代码,验证工作正常,但它不提交
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;
}
}
});
}
});
令人难以置信的是它输出到控制台的内容,它让我发疯,它永远迭代,我不得不手动停止它