Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javasscript method to allow numeric only entry

Status
Not open for further replies.

WIREMESH

Programmer
Mar 15, 2004
109
US
In my asp.net 2.0 vb application I have several textboxes that are used to enter numeric data.

Is there a javascript function I can use to prevent the entry of non numeric data for specific textboxes?

I would prefer the function ignore non numeric characters as they are entering the text into the control? Worst case, if they did enter non numeric characters, the control would blank out the field after the control loses focus.
 
use regular expression validator and use the expression as ^[0-9]+$

-DNG
 
your solution is not a javascript function that filters the keystrokes as they are entered
 
If you want a javascript function, then post in the javascript forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top