$.validator.addMethod("isPassword", function(value, element) { var reg = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{6,20}$/; return reg.test(value); }, "密码中必须包含含数字、字母、特殊符号");
$('#formTeacherReg').validate({ rules: { UserPwd: { required: true, minlength: 5, isPassword:true }, teacherRePwd: { required: true, minlength: 5, equalTo: "#teacherPwd", isPassword:true }, },
添加引用即可 标签:jquery,isPassword,自定义,minlength,zA,validate,true From: https://www.cnblogs.com/sexintercourse/p/17898991.html