$(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'){returntrue;}else{returnfalse;}},buttons:$("#submit"),error:function(jqXHR,textStatus,errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},onerror:"该客户分类名称已存在,请更换客户分类名称",onwait:"正在对客户分类名称进行合法性校验,请稍候..."});}) }