Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hai Everyone,

I have 10 textboxes. each texbox has to allow only alphanumeric.[1-9] and [a-z]
Some textboxes first 1st letter should be alphabet remaining will be numbers.
And some textboxes first two letter should be alphabet remaining will be numbers.

Example:
1) Textbox1: 1st character should be 'M' remaining should be numbers
2) Textbox2: 1st character should be 'W' remaining should be numbers
3) Textbox3: 1st 2 characters should be 'DL' or 'M' remaining should be numbers
4) Textbox4: 1st 2 characters should be 'PS' remaining should be numbers

etc...

Can any one help on this with generic javascipt function
Posted
Updated 23-Sep-15 2:13am
v2
Comments
aarif moh shaikh 23-Sep-15 8:26am    
Use Javascript Validation for it..

1 solution

If the prefix or suffix of a textbox is deterministic, there is no need to ask the user to remember and type, just display them as labels before and after the textbox, then prepend or append them to the number entered by the user using JavaScript before submission. As for allowing only numbers in the textbox, there are many examples on the Internet, such as this one: http://stackoverflow.com/questions/7295843/allow-only-numbers-to-be-typed-in-a-textbox[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900