$.validator.addMethod("dlmString", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9_\u4e00-\u9fa5]+$/.test(value);
}, "只能为中文字母数字或下划线");
$.validator.addMethod("dlmk", function(value, element) {
return this.optional(element) || !(/^[_][a-zA-Z0-9\u4e00-\u9fa5]*$/.test(value));
}, "_不能为开头");
$.validator.addMethod("dlmj", function(value, element) {
return this.optional(element) || !(/^[a-zA-Z0-9_\u4e00-\u9fa5]+[_]$/.test(value));
}, "_不能为结尾");
$.validator.addMethod("dlmNum", function(value, element) {
return this.optional(element) || !(/^[0-9]{6,}$/.test(value));
}, "不能都是数字");
$.validator.addMethod("dlmFf", function(value, element) {
return this.optional(element) || !(/^[a-zA-Z0-9\u4e00-\u9fa5]*<%=ff%>[a-zA-Z0-9\u4e00-\u9fa5]*$/.test(value));
}, "登录名含有非法字符");
$.validator.addMethod("mmx", function(value, element) {
return this.optional(element) || !(/^[a-z]{6,16}$/.test(value));
}, "登陆密码不能都为小写字母");
$.validator.addMethod("lx", function(value, element) {
return this.optional(element) || !(/^([0-9a-zA-Z])\1{5,15}$/.test(value));
}, "登陆密码不能使用连续相同的字母或数字");
$.validator.addMethod("xspd", function(value, element) {
var dlm = $("#dlm").val();
var zh = pinyin.go(dlm,1);
var dlmm = $("#dlmm").val().toLowerCase();
var dlmmlen = dlmm.length;
var zhlen = zh.length+2;
if(dlmmlen>zhlen){
return true;
}else{
var len = zh.length - 2;
zh = zh.substring(0,len);
dlmm = dlmm.substring(0,len);
if(dlmm == zh){
return false;
}else{
return true;
}
}
}, "您的登陆密码与用户名过于相似,请修改!");