$(function(){ $.formValidator.initConfig({formid:"myform",autotip:true}); $("#name").formValidator({onshow:"请输入客户分类名称",onfocus:"2到20个字符"}).inputValidator({min:2,max:20,onerror:"2到20个字符"}).ajaxValidator({ dataType : "html", async : true, url : "${pageContext.request.contextPath}/clientSortSTManage/clientSortST!isEqualClientSortName.action", success : function(data){ if(data=='true'){ return true; } else{ return false; } }, buttons: $("#submit"), error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);}, onerror : "该客户分类名称已存在,请更换客户分类名称", onwait : "正在对客户分类名称进行合法性校验,请稍候..." }); })
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2317/viewspace-2813149/ ,如需转载,请注明出处,否则将追究法律责任。