I need a jquery function to validate my textbox value.
Requirement: required filed:true, minlength:8, maxlength:16, should allow only alphabets, numbers.
i have written one function:
jQuery.validator.addMethod("nameRegex", function (value) {
// alert(value);
if (value.length >= 8) {
// alert(value.length);
return value.match(/^[a-zA-Z0-9 ]+$/.test(value));
}
}, "Contain only letters, numbers.");
but this is not working can any one pls help me in this.
-Sindhu.A
jquery functionsindhu April 5, 2012 at 11:14 AM
I need a jquery function to validate my textbox value. Requirement: required filed:true, minlength:8, maxlength:16, should allow only alphabets, numbers. i have written one function: jQuery.validator.addMethod("nameRegex", function (value) { // alert(value); if (value.length >= 8) { // alert(value.length); return value.match(/^[a-zA-Z0-9 ]+$/.test(value)); } }, "Contain only letters, numbers."); but this is not working can any one pls help me in this. -Sindhu.A
reslutssssss July 6, 2012 at 12:01 PM
very good........
Post your Comment