JQValidate
沈嘉瑞
2023-12-01
$(function () {
// alert("hhh");
$("form").click(function () {
// alert("form");
});
$("form").validate({
rules: {
Name: {
required: true, //必填
maxlength:3
},
Age:{
required:true,
number:true
},
Email: {
required: true,
email:true
}
},
messages: {
Name: {
required: "*",
maxlength: "所填信息超出长度范围!" //提示信息
},
Age:"*",
Email: {
required: "*",
email:"不符合email的格式"
}
}
});
});