Я использую JQuery для проверки подключаемого модуля и получения слишком большой ошибки рекурсии и понятия не имею, почему.JQuery validate - слишком много рекурсии - переполнение стека
Here's a fiddle to show the error (you can see it in firebug)
Для теста: введите «джон @ hotmailcom» в первом поле, а затем вкладка и увидеть Сообщи ошибки, а затем нажмите кнопку назад и изменить его на «[email protected]» и закладка снова
Здесь 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();
},
});
Любая идея, что это не так?
Событие 'Validate', инициированное из события' submit', будет типичным. Почему вы отправляете от успеха? –