wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets 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

validating that field has a number

Lauren Pender

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
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
[This message has been edited by Dave Vick (edited June 19, 2001).]

I agree. Here's the link: http://aspose.com/file-tools
subject: validating that field has a number
Similar Threads
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
sql query