My form has a textbox for entering Phone No.How to use custom validator to validate that only numeric value is allowed?
custom validator
Collapse
X
-
hi,
u can use the regular expression validator with
validation expression property set to [0-9]{3}-[0-9]{4}-[0-9]{6}
this will give u the format XXX-XXXX-XXXXXX
if u want alphabets the u can use [a-z]{3}-[0-9]{2}-[A-Z]{3}
this will give u the format XXX-XX-XXXX with first 3 letters in small letters followed by 2 digit number then followed by 3 captial letters
hope this helps u
all the best -
Originally posted by ashasprabhuhi,
u can use the regular expression validator with
validation expression property set to [0-9]{3}-[0-9]{4}-[0-9]{6}
this will give u the format XXX-XXXX-XXXXXX
if u want alphabets the u can use [a-z]{3}-[0-9]{2}-[A-Z]{3}
this will give u the format XXX-XX-XXXX with first 3 letters in small letters followed by 2 digit number then followed by 3 captial letters
hope this helps u
all the best
Thanks.It worked.Comment
Comment