DWZ(JUI)框架添加对移动手机号(11位)的验证

首先在 /bin/dwz.regional.zh.js中"alphanumeric"附近

拷贝

$.validator.addMethod("alphanumeric",function(value,element){return this.optional(element)||/^w+$/i.test(value)},"Letters, numbers or underscores only please");

修改为

$.validator.addMethod("mobilphone",function(value,element){return this.optional(element)||/^1(3|4|5|7|8)d{9}$/i.test(value)},"please input the right mobilphone num");

然后在/js/dwz.regional.zh.js中添加一个字段

mobilphone: "正确的手机格式",

清除cookie

原文地址:https://www.cnblogs.com/cmelody/p/6963536.html