Query Formvalidator plug-ins are very useful, but there is a serious bug, in the use of AJAX verification, if the contents of the input box already exists, put the mouse into the input box, do not make any changes to leave, it will prompt the error, this is the plug-in made a very stupid mistake
Copy Code code as follows:
Oneisvalid:function (ID, index) {
var returnobj = new Object ();
Returnobj.id = ID;
Returnobj.ajax =-1;
Returnobj.errormsg = ""; Custom error messages
var Elem = $ ("#" + ID). Get (0);
var settings = elem.settings;
var settingslen = settings.length;
There's only one formvalidator, no test.
if (Settingslen = = 1) {Settings[0].bind = false;}
if (!settings[0].bind) {return null;}
for (var i = 0; i < Settingslen; i++) {
if (i = = 0) {
if ($.formvalidator.isempty (ID)) {
Returnobj.isvalid = true;
returnobj.setting = Settings[0];
Break
}
Continue
}
returnobj.setting = Settings[i];
if (Settings[i].validatetype!= "Ajaxvalidator") {
$.formvalidator.triggervalidate (Returnobj);
} else {
Returnobj.ajax = i;
Settings[i].isvalid = true;
}
if (!settings[i].isvalid) {
Returnobj.isvalid = false;
returnobj.setting = Settings[i];
Break
} else {
Returnobj.isvalid = true;
returnobj.setting = Settings[0];
if (Settings[i].validatetype = = "Ajaxvalidator") break;
}
}
return returnobj;
},