<script type="text/
javascript" src="Scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="Scripts/jquery.validate.js"></script>
<script type="text/javascript" src="Scripts/jquery.validate.messages_cn.js"></script>
<script type="text/javascript">
$(function () {
$("#form1").validate(
{
/*自定义验证规则*/
rules: {
txtUsername: {
required: true, minlength: 6 },
txtEmail: { required: true, email: true }
},
/*错误提示位置*/
errorPlacement: function (error, element) {
error.appendTo(element.siblings("span"));
}
}
);
})
</script>