[jQuery] Validator | does not submit ajax function in Firefox
In IE it works fine but in FF I have to click again to make it go.
Here is the code:
ajax function-
function ajaxForm() {
$("#researchCenterForm").submit(function() {
$.ajax({
data:$("#researchCenterForm").serialize(),
url: this.action,
timeout: 2000,
error: function() {
console.log("Failed to submit");
},
success: function(response) {
if (response == "YES") {
$("#researchcenter div.research-mainbox-title
h3").replaceWith("<h3>You Qualify For This Study!</h3>");
$("#researchCenterInitialForm").css('display','none');
$("#yesQualify").css('display','block');
} else if (response == "NO") {
$("#researchcenter div.research-mainbox-title
h3").replaceWith("<h3></h3>");
$("#researchCenterInitialForm").css('display','none');
$("#noQualify").css('display','block');
}
var targetOffSet = $("#researchcenter").offset().top - 10;
$("html,body").animate({
scrollTop: targetOffSet
}, 650);
}
});
return false;
});
}
And in the validator function I have the method and property:
submitHandler: function() {
ajaxForm();
}
Any suggestions or hacks?