$("#qydm").formValidator({onshow:"请输入用户名",onfocus:"用户名至少1个字符,最多8个字符",oncorrect:"该用户名可以注册"}).inputValidator({min:1,max:8,onerror:"你输入的用户名非法,请确认"}).regexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式不正确"})
.ajaxValidator({
type : "get",
url : "check.jsp",
//data: "user="+escape($('#qydm').val()),
cache :false,
datatype : "json",
success : function(data){
alert(data);
if( escape(data)=="1" )
{
//alert(document.getElementById('qydm').value);
return true;
}
else
{
alert(data);
return false;
}
},
buttons: $("#button"),
error: function(){alert("服务器没有返回数据,可能服务器忙,请重试");}
jsp 和 formValidator 动态验证 用户名
最新推荐文章于 2024-07-05 11:30:59 发布