views:

32

answers:

1

Hi,

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

+2  A: 

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

Tommy