Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I Have a TextBox that accepts only numbers.I want that it accepts only 10 digits.
Posted
Comments
thatraja 30-Jun-10 2:57am    
A few days back i have seen this same question here. Mate, show us your code which you have tried.

To accept only number you can try

http://www.cambiaresearch.com/c4/029c978b-aac5-472e-97a8-95b256f5febd/How-Can-I-Use-Javascript-to-Allow-Only-Numbers-to-Be-Entered-in-a-TextBox.aspx[^]

To accept only 10 digits set the MaxLength value of the textbox to 10
 
Share this answer
 
TextBox?, if you are using ASP.net you can use only RegularExpressionValidator Control[@] for do all this work (ValidationExpression="\d{10}")
 
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