0

I want to validate the textbox which should accept only "letters" and "." and "/".

how to do this using jquery plugin?

thanks in advance.jquery vlidt

Gnaniyar Zubair
  • 8,114
  • 23
  • 61
  • 72

1 Answers1

3

You will need to extend the validation plugin to use a regular expression as discussed in this post here: StackOverflow

    $.validator.addMethod( 
        "regex", 
        function(value, element, regexp) { 
            var check = false; 
            var re = new RegExp(regexp); 
            return this.optional(element) || re.test(value); 
        }, 
        "Please check your input." 
); 

$("Textbox").rules("add", { regex: "^[a-zA-Z./]+" })  - I think this reg expression is right...?

And for your specific example, a list of regular expressions can be found here

Community
  • 1
  • 1
Tommy
  • 39,592
  • 10
  • 90
  • 121