my dog learned polymorphism
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: validating that field has a number
 
Similar Threads
where to check the length instance variable for an Array
sql query
Adding row dynamically and sending all rows value to servlet
cant log on to certmanager
key field is record number or flight number?