1. Home
  2. Computing & Technology
  3. JavaScript

Additional Form Field Validations

Form Field Validation scripts and how-tos by your Javascript Guide.
Remove Formatting from Numbers
Allow your visitors to use formatting with the numbers they enter (currency symbols on amount fields, thousands separators on numbers, and whatever formatting they usually use on phone numbers) and then extract and save just the number using a single line of JavaScript.
Selecting Today's Date
There are a number of reasons why you might need to have a date entered in a form. Since date formats vary around the world you probably don't want your visitors typing in their selected date since that can be open to misinterpretation. Instead we can provide three drop down lists to individually select the day, month, and year.
Clearing or Hilighting Default Text
Place default text in an input field and have it clear automatically when the field is accessed or have the field content selected ready to cut and paste. This page shows you how.
Counting Words
Have you ever thought that it would be useful to be able to count the number of words that have been typed into a text field or text area. Well here's a script that dynamically keeps track of how many words have been entered.
Disable the Enter Key
The enter key performs different functions depending on whether your visitor is in a textarea in a form on your page, elsewhere in a form, on somewhere not in a form at all. You may want to avoid all of this confusion by just ignoring all enter key presses on your page.
Automatic Tabbing
Have your forms automatically shift from one field to the next when the required number of characters have been entered.
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Validating Forms
  5. Yet More Validations

©2009 About.com, a part of The New York Times Company.

All rights reserved.