|
This shows another method to
Validates a phone number
Validates a zip code based on
The purpose of this script is
verify text boxes input and
against the regular
both US zip code schemes:
to format and validate
then put the focus into
expression: (555) 555-1234
12345-1234 or 12345
Telephone Numbers in a form
missing data boxes. It also
field. The script strips all
checks some things to see if
non-numeric characters and
the email is
then validates that the
"valid" - other
remaining characters are
tests could be added as
sufficient to make up a
determine viable. The alerts
valid phone number. If there
can be used, but they
remaining string is 10
conflict with the focus
characters in length, the
thing going on.
script then formats by
adding a “-” after the third
and sixth digits. Resulting
in a mask like ###-###-####.
Date: Dec, 04 2000 Date: Feb, 05 2006 Date: Feb, 05 2006 Date: Oct, 27 2006 |
|
The purpose of this script is
Let Javascript help you
Validates an input field to
Many forms will require the
to format and validate
receive feedback from your
make sure that only a number
user to enter an email
Social Security Numbers in a
visitors. The script also
or character is entered. If
address twice (to check for
form field. The script
requires that all fields
you enter a number or a
typographical errors). This
strips all non-numeric
must be completed before the
letter everything you can
script immediately notifies
characters and then
form is submitted.
continue on. But, entering
the user when the two fields
validates that the remaining
another value like an
match - it's a nice,
characters are sufficient to
exclamation point (!), an
user-friendly touch, and
make up a valid SSN. If
ampersand (&), or a
safe for all browsers.
there remaining string is 9
dollar sign ($), you will be
characters in length, the
prompted with a warning
script then formats by
message. It even highlights
adding a “-” after the third
the incorrect entry field
and fifth digits. Resulting
for you.
in a mask like ###-##-####.
Date: Oct, 27 2006 Date: Aug, 10 1999 Date: Aug, 10 1999 Date: Apr, 07 2004 |