日期:2014-05-17 浏览次数:20996 次
<script type="text/javascript">
$(document).ready(function(){
$.formValidator.initConfig({onsuccess:function(){document.forms['form1'].submit();return true;},
onerror:function(msg){alert(msg)}});
$("#name").formValidator({onshow:"长度不超过32个字符",
onfocus:"长度不超过32个字符",oncorrect:"输入格式正确"}).
inputValidator({min:1,max:64,onerror:"不能为空或者超过32个字符,请确认"}).
regexValidator({regexp:"chinese",datatype:"enum",onerror:"企业名称为中文"})
.ajaxValidator({
type : "post",
url : "../dictsDaoru?method=modValidator",
datatype : "json",
success : function(data){
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
// buttons: $("#button"),
error: function(){alert("服务器没有返回数据,可能服务器忙,请重试");},
onerror : "已存在该企业,请修改",
onwait : "正在对企业名进行合法性校验,请稍候..."
});