<script src="https://www.jb51.net/Jquery1.7.js" type="text/javascript"></script>
<script src="https://www.jb51.net/jquery.validate.js" type="text/javascript"></script>
<script src="https://www.jb51.net/messages_cn.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#form1').validate({
rules: {
txtUser: { required: true, minlength: 6 },
txtPassword: { required: true, minlength: 6 },
txtConfirm: { required: true, minlength: 6, equalTo: "#password" },
txtHomePage: { required: true, url: true },
txtBirthday: { required: true, dateISO: true },
txtXueYa: { required: true, digits: true },
txtEmail: { required: true, email: true }
},
errorshow: function (error, element) {
error.appendTo(element.siblings('span'));
}
})
})
</script>
</head>
<body>
<form action="">
<table>
<tr>
<td>用户名:</td>
<td><input type="text" /><span>*</span> </td>
</tr>
<tr>
<td>密码:</td>
<td><input type="text" /><span>*</span> </td>
</tr>
<tr>
<td>确认密码:</td>
<td><input type="text" /><span>*</span> </td>
</tr>
<tr>
<td>主页:</td>
<td><input type="text" /><span>*</span> </td>
</tr>
<tr>
<td>生日:</td>
<td><input type="text" /><span>*</span> </td>
</tr>
<tr>
<td>血压:</td>
<td><input type="text" /><span>*</span> </td>
</tr>