I would like to validate my form with jquery validation plugin. I added a method for on input:
$.validator.addMethod("testRegex", function(value, element) {
return this.optional(element) || /^[a-z0-9-_]+$/i.test(value);
}, "test must contain only letters, numbers, underscores or dashes");
But I want a validation to check if the value is only lowercase. And This validation doesn't work.
Do you have an idea?