[jQuery] (validate) Form needs to be submitted twice
Hello. I have encountered a problem using remote validation where my
form does not post until the second time the submit button is
clicked. If I remove the remote validation everything works
correctly. As it is everything works except that the submit button
must be clicked twice. Thank you for any help with this issue.
Below is the relevant .js code. I can post the entire page if needed.
$(document).ready(function(){
$("#f").validate({
rules: {
first_name: {required: true},
last_name: {required: true},
password: {required: false, minlength: 5},
password_confirm: {equalTo: "#f input:password"},
email: {
required: true,
email: true,
remote: {
url: "/ajax/unregistered_user_email.php",
type: "post",
data: {
email: function() { return $("#email").val() },
origemail: function() { return $("#origemail").val() }
}
}
}
},
messages: {
email: {remote: "This email address has already been
registered."},
password_confirm: { equalTo: "Confirmation does not match the
password."}
}
});
});