Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to pass custom regex in jquery validation

$.validator.addMethod(
        "regex",
        function(value, element, regexp) {
            var re = new RegExp(regexp);
            return this.optional(element) || re.test(value);
        },
        "Please check your input."
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #custom #regex #jquery #validation
ADD COMMENT
Topic
Name
1+9 =