to validate the name entered by user, i am using this expression "/^[a-zA-Z, ,]/". The name should contain only alphabets and space, if anything other than these two appear in the string, it should output alert msg. Is this expression correct? it is working fine only when numbers are entered, if number is entered along with alphabets, it doesnt work. what changes do i need to do any suggestions pls
i thought i had figured the correct regular expression to check the name, but i was wrong, when i matched the names like nike11 with above mentioned expression, it was matching..initially it wasnt matching as there were some other issues with the codes.
anybody out there, pls help me figure out the correct expression..
hi buddy.. try this, it ll surely work..
the expression is this.. [a-zA-Z, ,]*
if u are using .net tech, for building then, go to the property window of the regular expression validator, choose the "display" mode to "dynamic" and then go for another property as "validation expression" as " [a-zA-Z, ,]* ".
and u are done. it will work.
try it and tell..