Validating Numerical Input with JavaScript
What? Make a mistake entering data? Who me? NO WAY! RightÂ…
Every form of data input by a user should be validated in some form or fashion. If you get
clean data in, you wonÂ’t get garbage out. This tutorial is going to explain how to validate
numerical data entered into a form using JavaScript.
First, let us begin with the code to insert the JavaScript into your HTML document.
Place these lines between the
and tags.This line tells the web browser to expect some JavaScript code and signal the beginning of
the script:
Next let us hide the code from web browsers that are not capable of reading the script with
this line:
Then to finish the standard JavaScript entry, place these lines after your code:
//STOP HIDING
So now the format should look something like this:
Authur Information:
(c)2004 BiosBrain
David Morse is the owner of http://www.biosbrain.com which is a full service support site featuring articles on programming, graphics, web-based business and more! Come visit us today!
Comments
Leave a Reply
You must be logged in to post a comment.