<script type=
"text/javascript"
src=
"js/jquery-1.9.1-min.js"
></script>
<script type=
"text/javascript"
src=
"js/jquery.validate.js"
></script>
<script type=
"text/javascript"
>
$(
function
(){
$(
"#fm"
).validate({
rules:{
'stuname'
:{
required:
true
},
'stupassword'
:{
required:
true
,
rangelength:[6,20]
},
'repassword'
:{
required:
true
,
rangelength:[6,20],
equalTo:
"#stupassword"
},
'stunumber'
:{
required:
true
,
remote:
'/reg.jspx'
}
},
messages:{
'stuname'
:{
required:
'请输入用户名'
,
},
'stupassword'
:{
required:
'请输入密码'
,
rangelength:
'密码长度6~20位'
},
'repassword'
:{
required:
'请输入确认密码'
,
rangelength:
'密码长度为6~20位'
,
equalTo:
'两次密码输入不一致'
},
'stunumber'
:{
required:
'请输入学号'
,
remote:
'该学号已占用'
}
}
});
$(
"#zuce"
).click(
function
() {
//alert("haha");
$(
"#fm"
).submit();
});
});
</script>
|
jQuery实现登录注册验证
最新推荐文章于 2023-08-15 20:00:00 发布