This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes validating that field has a number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "validating that field has a number" Watch "validating that field has a number" New topic
Author

validating that field has a number

Lauren Pender
Greenhorn

Joined: Jun 15, 2001
Posts: 5
I would like to validate in javascript that the text entered in a field is a number.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Lauren
use this test
if (isNaN(document.formName.fieldName.value))
if it returns true then the value in the field is not a number.
hope that helps
Dave
[This message has been edited by Dave Vick (edited June 19, 2001).]


Dave
 
Don't get me started about those stupid light bulbs.
 
subject: validating that field has a number
 
Similar Threads
sql query
cant log on to certmanager
key field is record number or flight number?
Adding row dynamically and sending all rows value to servlet
where to check the length instance variable for an Array