JQuery Validation for Alphabets fiels

Posted on Posted in JQuery

jQuery.validator.addMethod(‘alpha’, function(value, element) {
return this.optional(element) || /^[a-z\s]+$/i.test(value);
}, “This field contain only letters.”);

Leave a Reply

Your email address will not be published. Required fields are marked *