[del][del]$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){alert('ddd');return false;}});
$("#test1").formValidator({onshow:"请输入用户名,只有输入\"maodong\"才是对的",onfocus:"用户名至少6个字符,最多10个字符",oncorrect:"该用户名可以注册"}).inputValidator({min:6,max:10,onerror:"你输入的用户名非法,请确认"}).regexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式不正确"})
.ajaxValidator({
type : "get",
url : "Default.aspx",
datatype : "json",
success : function(data){
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
buttons: $("#button"),
error: function(){alert("服务器没有返回数据,可能服务器忙,请重试");},
onerror : "该用户名不可用,请更换用户名",
onwait : "正在对用户名进行合法性校验,请稍候..."
});大师们,这些代码中间的我还行,就是有几句不太明白
$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){alert('ddd');return false;}});
这句是什么意思?
还有
buttons: $("#button"),如果能系统的讲一下更感激不尽啦
$("#test1").formValidator({onshow:"请输入用户名,只有输入\"maodong\"才是对的",onfocus:"用户名至少6个字符,最多10个字符",oncorrect:"该用户名可以注册"}).inputValidator({min:6,max:10,onerror:"你输入的用户名非法,请确认"}).regexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式不正确"})
.ajaxValidator({
type : "get",
url : "Default.aspx",
datatype : "json",
success : function(data){
if( data == "1" )
{
return true;
}
else
{
return false;
}
},
buttons: $("#button"),
error: function(){alert("服务器没有返回数据,可能服务器忙,请重试");},
onerror : "该用户名不可用,请更换用户名",
onwait : "正在对用户名进行合法性校验,请稍候..."
});大师们,这些代码中间的我还行,就是有几句不太明白
$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){alert('ddd');return false;}});
这句是什么意思?
还有
buttons: $("#button"),如果能系统的讲一下更感激不尽啦
formid: "form1",//表单名称
onerror: function(msg){//出错时处理方法
alert(msg)
},
onsuccess: function(){//成功时处理方法
alert('ddd');
return false;
}
});
$("#test1").formValidator({
onshow: "请输入用户名,只有输入\"maodong\"才是对的",
onfocus: "用户名至少6个字符,最多10个字符",
oncorrect: "该用户名可以注册"
}).inputValidator({
min: 6,
max: 10,
onerror: "你输入的用户名非法,请确认"
}).regexValidator({
regexp: "username",
datatype: "enum",
onerror: "用户名格式不正确"
}).ajaxValidator({
type: "get",
url: "Default.aspx",
datatype: "json",
success: function(data){
if (data == "1") {
return true;
}
else {
return false;
}
},
buttons: $("#button"),//触发事件的按钮
error: function(){
alert("服务器没有返回数据,可能服务器忙,请重试");
},
onerror: "该用户名不可用,请更换用户名",
onwait: "正在对用户名进行合法性校验,请稍候..."
});
大师,我补充一句
这句很重要吗,必须要加?不加会怎样
是啥意思呢