Remotefunction (value, element, param) {
ParamIt's yours.RulesThe parameters specified in here are definitelyRemoteThe parameters in the
ValueIs the value you entered
ElementIs the element you manipulate, the label
if (This.Optional (Element)) {
Return"Dependency-mismatch";
}
VarPrevious =This.Previousvalue (Element),
ValidatorData
if (!This.Settings.Messages[element.Name]) {
This.Settings.Messages[element.Name] = {};
}
Previous.Originalmessage =This.Settings.Messages[element.Name].Remote
This.Settings.Messages[element.Name].Remote =Previous.Message
param =typeof param = = ="String" && {Url:param} | | Param
if (Previous.Old!== value) {
Previous.old = value;
Validator =This
This.Startrequest (Element);
data = {};
Data[element.Name] = value;//Data in the input box
$.Ajax ($.ExtendTrue, {
Url:param,
Mode"Abort",
Port"Validate" + element.Name
DataType:"JSON",
DataData
ContextValidator.Currentform,
SuccessFunction (response) {
Varvalid = response[' value '] = = =true | | response[' value '] = = ="True",ErrorsMessageSubmitted;
Validator.Settings.Messages[element.Name].Remote =Previous.Originalmessage;
if (Valid) {
Submitted =Validator.formsubmitted;
Validator.Prepareelement (Element);
Validator.formsubmitted =Submitted;
Validator.Successlist.push (Element);
DeleteValidator.Invalid[element.Name];
Validator.ShowErrors ();
}else {
Errors = {};
message = response[' Msg ' | |Validator.Defaultmessage (element,"Remote");
Errors[element.Name] =Previous.Message = $.Isfunction (Message)?message (value): message;
validator. invalid[element.true;
validator. showerrors (errors);
}
previous. valid = valid;
validator. stoprequest (element, valid);
}
}, param));
return " Pending ";
}
} /span>
Modify the remote of jquery to let the previous section display server error messages