<htmL><head><meta charset="utf-8"> <style type="text/css">input{ display: block; margin-bottom: 40px;} </style> <script type="text/javascript" src="jquery-1.9.1/jquery.js"></script> <script type="text/javascript" src="vendor/jquery.validate-1.13.1.js"></script></head><body> <form id="f1"> <input type="text" name="username" id="username"> <input type="password" name="password" id="password"> </form> <script type="text/javascript"> $("#f1").validate({ rule:{ username:{ minlength:2, maxlength:16, required:true, email:true }, password:{ minlength:2, maxlength:16, required:true, email:true } }, messages:{ username:{ minlength:"最小不能小于2", maxlength:"最大不能大于16", required:"必填", email:"填写正确的邮箱" }, password:{ minlength:"最小不能小于2", maxlength:"最大不能大于16", required:"必填", email:"填写正确的邮箱" } } }) </script></body></html>
添加回答
举报
0/150
提交
取消