Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one.

I have a numeric code in my form, that it have 3 parts.
First part is 3 numbers, then 6 numbers, and finaly, the last one, Something like this :

123-456789-0

I can make my text box numeric. But how can i force my text box to add those dahes ( - ). And maxlengh 12 charchters with those 2 dashes.

Thanks in Advance.
Posted

1 solution

hi,
u can do this using regular expression in javascript
for this try this link it will help u lot
http://ntt.cc/2008/05/10/over-10-useful-javascript-regular-expression-functions-to-improve-your-web-applications-efficiency.html[^]

Best luck
 
Share this answer
 
Comments
arminamini 7-Apr-12 6:42am    
Thank u, it was very useful.
And plz do u know any web page for translate all Reg exp words. and how making this regs ?
Nilesh Patil Kolhapur 7-Apr-12 6:45am    
search on google it will help u lot boss. always try to minimize serverside hit. best luck happy coding

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