JavaScript Single Field Validation - Example 2
This example provides tighter checking than Example 1. The fields are
checked as soon as you change their value rather than waiting for the
"Send" button to be clicked. This example also checks for specific
characters and range of values.
Source: View or Save this HTML file
to obtain the scripts used to do this validation. The scripts are part
of the file.