日期:2014-05-17 浏览次数:21081 次
$("#register_form").validate({
rules : {
'user.usrRegname' : {
required : true,
maxlength : 15,
minlength : 6,
isUsername : true,
remote : {
type : "post",
url : "usr!exists",
data : {
'user.usrRegname' : function() {
return $("#usrRegname").val();
}
},
dataType : "html",
dataFilter : function(data, type) {
var obj = jQuery.parseJSON(data);
return obj.flag;
}
}
},
'user.usrPassword' : {
required : true,
maxlength : 16,
minlength : 6
},
'rePassword' : {
required : true,
equalTo : "#usrPassword"
},
'user.usrRealname' : {
required : true,
maxlength : 16,
minlength : 2
},
'usrBirthday' : {
required : true,
isBirthday : true
},
'user.usrSchool' : {
required : true,
maxlength : 16,
minlength : 2
},
'usrSchoolyear' : {
required : true,
maxlength : 4,
number : true,
minlength : 4
},
'user.usrFaculty' : {
required : true,
maxlength : 16,
minlength : 4
},
'user.usrClass' : {
required : true,
maxlength : 16,
minlength : 4
},
'user.usrEmail' : {
required : true,
email : true
},
'user.usrIdnumber' : {
required : true,
idCard : true
},
'user.usrPhone' : {
required : true,
isMoblie : true
},
'user.usrQuestion' : {
required : true,
maxlength : 16
},
'user.usrAnswer' : {
required : true,
maxlength : 16
},
'user.usrQq' : {
required : true,
number : true,
maxlength : 12
},
'user.usrSkill' : {
required : true,
maxlength : 90