I'm using JQuery validate plug in and getting too much recursion error and have no idea why.
Here's a fiddle to show the error (you can see it in firebug)
To test: enter "john@hotmailcom" in first field, then tab out and see error msg, then click back in and change it to "[email protected]" and tab out again
Here the JQ:
// ensure password contains at least one number and one letter
$.validator.addMethod("passwordRegex", function(value, element) {
return this.optional(element) || /[a-z].*[0-9]|[0-9].*[a-z]/i.test(value);
}, "Password must contain letters & numbers");
$("#groupReg").validate({
errorElement: 'span',
errorClass: 'field-validation-error2',
rules: {
Email: {
required: true,
email: true
},
EmailConfirm: {
required: true,
email: true,
equalTo: Email
},
Password: {
required: true,
minlength: 6,
passwordRegex: "Password format not valid"
},
},
messages: {
Email: {
required: "to continue, please enter your email address",
email: "that's not a valid email address"
},
EmailConfirm: {
required: "to continue, please enter your email address again",
email: "that's not a valid email address",
equalTo: "Please ensure the email addresses match"
},
Password: {
required: "to continue, please enter a password using letters and numbers",
minlength: "Your password must be at least 6 characters long"
}
},
success: function() {
$( "#groupReg" ).submit();
},
});
Any idea what's wrong?
Validateevent triggered fromsubmitevent would be typical. Why are you submitting from the success?