Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Validate textbox to allow only numeric values.
Posted

Code example for Accept numbers[^]
Fiddle for this^referred from SO[^]
The logic is to check on every key press in the textbox check for the character code and accept or ignore.
Hope this helps.
Thanks.
 
Share this answer
 
Check using following stated way


Isnumeric(Textbox1.text)
 
Share this answer
 
if you read the Code Project Quick Answers FAQ[^] it cleary mensined to do some searching before asking question, for example there are maney resources avalable in the intenet in related to your topic, below are taken from code project:
Allow only Numeric values in ASP Text box control using JavaScript[^]
TextBox which accepts only numbers[^]
try them and still you couldn't find solution or facing issues, then you come here and ask specific question with related codes, error details etc..
 
Share this answer
 
v2
Comments
MJ2014 9-Nov-14 12:25pm    
Check Using following function as shown
IsNumeric(Textbox1.text)

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