jqueryvalidate如何校验多个相同name
(2022-04-10 13:53:19)
标签:
jqueryvalidate |
分类: 前端开发 |
当前页面加入:
$.validator.prototype.elements = function ()
{
var validator = this,
rulesCache
= {};
return
$(this.currentForm)
.find("input, select,
textarea")
.not(":submit, :reset, :image,
[disabled]")
.not(this.settings.ignore)
.filter(function () {
if (!this.name &&
validator.settings.debug && window.console) {
console.error("%o has no name assigned",
this);
}
rulesCache[this.name] = true;
return true;
});
}
if ($.validator) {
参考: