elements: function() {var validator = this,
rulesCache = {};
// select all valid inputs inside the form (no submit or reset buttons)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);
}
// 注释掉这里// select only the first element for each name, and only those with rules specified//if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) {// return false;//}
rulesCache[this.name] = true;
returntrue;
});
},
方式2:修改jquery.validate.min.js文件
用 ctrl+F 查找(c[this.name]=!0,!0)})
return !this.name && b.settings.debug && window.console && console.error("%o has no name assigned", this),
//this.name in c || !b.objectLength(a(this).rules()) ? !1 : (c[this.name] = !0, !0)//注释这行
c[this.name] = !0, !0//添加这行