jQuery Validation submitHandler issue in Safari and Chrome

There is an odd issue with the jQuery Validation plugin’s submitHandler callback with Chrome. To validate the form I had my function setup as follows:


$("#signup_form").validate({
submitHandler: function(form) {
alert("Test");
form.submit();
}
});


The alert box and form submitted correctly in Firefox. However in Chrome, the alert box worked, but after that the form refused to submit. I narrowed down the issue to be with the actual name of the submit input on the form. I had named the submit input “submit”, which had some sort of conflict with the plugin. Renaming the submit input to anything else, like “newname” fixes the issue.
In short, to fix this, change:


<input type="submit" name="submit" value="Sign Up" />


to


<input type="submit" name="newname" value="Sign Up" />x

Post a Comment

Post a Comment (0)

Previous Post Next Post