<script type="text/javascript" src="${base}/shop/js/jquery.validate.min.js"></script> <script> $(document).ready(function () { $("#commentForm").validate({ rules: { contactName: "required", name_1: "required", pinyin_1: "required", credentials_1: "required", contactMobile: { required: true, minlength: 11 // 自定义方法:校验手机号在数据库中是否存在 //isMobile : true }, }, messages: { contactName: "姓名不能为空", name_1: "姓名不能为空", pinyin_1: "不能为空", credentials_1: "不能为空", contactMobile: { required: "请输入手机号", minlength: "确认手机不能小于11个字符" //isMobile : "请正确填写您的手机号码" }, } }); }) </script>
validate 自定义验证
最新推荐文章于 2024-07-09 10:05:35 发布