Click here to Skip to main content
15,921,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

There is textbox control in my webform for phone no(US format).

Here I dont want allow to enter the no in it except the

123-456-7890 format

My requirement is

When the user enter first 3digints into the textbox automatically the ' - ' should be present in textbox & again after entering 3digits the ' - ' should be present and aganin after entering remaining 4digits in it. after that i wont be allow to accept other no.s.. The same process should be run when the user erases the phone no into that field..

Thanks
Posted

1 solution

Create a Javascript function to do this and call it on the onkeyup event of the 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