Answers for "how to pass custom regex in jquery validation"

0

how to pass custom regex in jquery validation

$("#Textbox").rules("add", { regex: "^[a-zA-Z'.\\s]{1,40}$" })
Posted by: Guest on July-04-2020
0

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."
);
Posted by: Guest on July-04-2020

Code answers related to "how to pass custom regex in jquery validation"

Code answers related to "Javascript"

Browse Popular Code Answers by Language