$.validator.addMethod(
"regexName",
function(value, element) {
var check = false;
var re = new RegExp('^[a-zA-Z _0-9.]+$');
return this.optional(element) || re.test(value);
},
"No special characters allowed!"
);
rules: {
LoginName: {
required: true,
regexName:true
},
No comments:
Post a Comment