把以下代码在页面上边执行就可以了
if ($.validator) {
$.validator.prototype.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 );
}
rulesCache[ this .name] = true ;
return true ;
});
}
}