JQuery EasyUI 之 validatebox plugin
自定义验证:
$.extend($.fn.validatebox.defaults.rules,{
remote2:{
validator:function(value,param){
var postdata={};
postdata[param[1]]=value;
var result=$.ajax({
url:param[0],
dataType:"json",
data:postdata,
async:false,
cache:false,
type:"post"
}).responseText;
return result=="true";
},
message:"Please fix this field."
}
remote2:{
validator:function(value,param){
var postdata={};
postdata[param[1]]=value;
var result=$.ajax({
url:param[0],
dataType:"json",
data:postdata,
async:false,
cache:false,
type:"post"
}).responseText;
return result=="true";
},
message:"Please fix this field."
}
});