У меня небольшая проблема с проверкой jquery.В IE 6 и, может быть, в IE 7 я получил сообщение об ошибке: Ожидаемый идентификатор ....
Я свернул свой код и, кажется, если я вырезал следующую часть, то все работает нормально.В чем проблема?
Я действительно не понимаю, где дополнительная запятая, поэтому я решил вставить скрипт проверки дыры.Пожалуйста, посмотрите на мой код.
jQuery.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-zőöüóúéáűí ]+$/i.test(value);
}, "... betűket használjon");
$("#test").validate({
rules: {
name: {
required: true,
minlength: 5,
maxlength: 40,
lettersonly: true
},
addr: {
required: true,
minlength: 15,
maxlength: 80
},
phone: {
required: true,
minlength: 8,
maxlength: 20,
number: true
},
email: {
required: true,
minlength: 5,
email: true
},
count: {
required: true,
minlength: 3,
maxlength: 20,
number: true
},
nettoj: {
minlength: 2,
maxlength: 20,
number: true
},
nettoj2: {
minlength: 2,
maxlength: 20,
number: true
},
mini: {
minlength: 2,
maxlength: 20,
number: true
},
mini2: {
minlength: 2,
maxlength: 20,
number: true
},
adosj: {
minlength: 3,
maxlength: 20,
number: true
},
amini: {
minlength: 2,
maxlength: 20,
number: true
},
stil: {
minlength: 2,
maxlength: 20,
number: true
},
tcount: {
minlength: 2,
maxlength: 20,
number: true
},
city: {
minlength: 3,
maxlength: 60,
lettersonly: true
},
},
messages: {
name: {
required: "... !",
minlength: "Minimum 5 ",
maxlength: "Maximum 40 "
},
addr: {
required: "... ",
minlength: "Minimum 15 ",
maxlength: "Maximum 80 "
},
phone: {
required: "... ",
minlength: "Minimum 8 ",
maxlength: "Maximum 20 ",
number: "... "
},
email: {
required: "... e-mail ",
minlength: "Minimum 5 ",
email: "..."
},
count: {
required: "... ",
minlength: "Minimum 3 ",
maxlength: "Maximum 20 ",
number: "... "
},
nettoj: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
nettoj2: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
mini: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
mini2: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
adosj: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
amini: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
stil: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
tcount: {
minlength: "Minimum 2 ",
maxlength: "Maximum 20 ",
number: "... "
},
city: {
minlength: "Minimum 3 ",
maxlength: "Maximum 80 "
},
},
});