在我的网站上,我需要在表单中使用验证,但是表单有选项卡。运行时.validate()
我要 highlight
无效的输入并弹出一条摘要消息,说明您遇到问题并转到 X 选项卡来修复它。 showErrors
似乎阻止了 highlight
方法
弹出作品,highlight
没有。删除showError
和highlight
作品
这是我的代码:
$("#frmMyForm").validate({
onclick: false,
onkeyup:false,
ignore: ":disabled",
rules: {
PasswordExpiryDays: { required: true, number: true, min: 30, max: 90 },
PasswordStrength: { required: true, number: true, min: 10, max: 50 }
},
messages: {
PasswordExpiryDays: {
required: " This can't be left blank",
min: "Please enter a number between 30 and 90",
max: "Please enter a number between 30 and 90"
},
PasswordStrength: {
required: " This can't be left blank",
min: "Please enter a number between 10 and 50",
max: "Please enter a number between 10 and 50"
}
},
showErrors: function (errorMap, errorList) {
//code for error message pop-up
}
});
最佳答案
好的,包括
this.defaultShowErrors();
在 showErrors
上修复了问题
关于javascript - jQuery 验证 showError block 突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36060880/