xlh : {
validators : {
trigger : 'change',
notEmpty : {
message : '序列号不能为空'
},
threshold : 15,// 有2字符以上才发送ajax请求
remote : {// ajax验证。server result:{"valid",true or false}
url : appPath + "/app/chanpin/check/",
message : '该条形码已经存在',
delay : 500,// ajax刷新的时间是1秒一次
type : 'POST',
// 自定义提交数据,默认值提交当前input value
data : function(validator) {
return {
userName : $("input[name=userName]").val(),
method : "checkUserName"// UserServlet判断调用方法关键字。
};
}
}
}
}