/*** check Mobile***********************/ jQuery.validator.addMethod("isMobile", function(value, element,param) { //var pattern=/(^0{0,1}[13|15|18|14|17]{2}[0-9]{9}$)/; var pattern= /(^1[3,4,5,7,8]{1}[0-9]{9}$)/; //var pattern = /(?:\(?[0\+]?\d{1,3}\)?)[\s-]?(?:0|\d{1,4})[\s-]?(?:(?:13\d{9})|(?:\d{7,8}))/; if(pattern.test(value)){ return true; }else{ return false; } }, "请输入正确的手机号");
$(‘#editForm‘).validate({ rules : { idcard: { ?idCard:true, } }, messages : { idcard: { idCard: ‘请输入正确的15位或18位身份证号码‘, } } });
时间: 2024-11-03 04:14:57