<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
无标题文档 .login_input2{margin:50px 0px ;} $(function(){ $('#reg-form').validate({ rules: { username:{ required:true, minlength:5, maxlength:16, remote:{ url: "check.php", type:"post", dataType:"json", data:{ username:function(){ return $('#username').val(); } } } }, password:{ required:true, minlength:5, }, repassword:{ required:true, minlength:5, equalTo:"#password" } }, messages:{ username:'请输入用户名', password:{ required:"请输入密码", minlength:jQuery.format("密码不能小于{5}个字符") }, repassword:{ required:"请输入确认密码", minlength:"确认密码不能小于5个字符", equalTo:"两次密码不一致" } }, }); });
<input name="username" type="text" class="login_input2" placeholder="用户名(用作登录)" id="username" >
<input name="password" type="password" class="login_input2" placeholder="用户密码(6~16位字符,注意大小写)" id="password">
<input name="repassword" type="password" class="login_input2" placeholder="确认密码(注意大小写)" id="repassword">
<input name="telphone" type="text" class="login_input2" placeholder="请输入您的手机号码" id="telphone">
<input type="text" name="verify" class="login_input2" placeholder="请输入验证码" id="verify">
<button type="submit" class="" id="send" >立即注册</button>
</form></div>