JavaScript Slick Form Verification

This is a example of a slick JavaScript form error checker. Interactive formatting is done on some of the text as the user exits the name and phone fields. Also some basic error checking is preformed before the form is submitted. See below for details.

NOTE: This form has not been configured for the new server yet, but you can still test the JavaScript input corrections, the form will just give an error when it tries to submit.



    Name :   [any value]
    Email :  [name@domain]
    Phone :  [1112223333]

This JavaScript performs the following tricks...

Interactive Checking / Corrections:

  1. The script automatically sets the focus on the Name field when the document is loaded.
  2. The name field is capitalized when the user exits the field.
  3. The phone field is formatted if it has 10 or eleven characters in it.
  4. All spaces are removed from the ends of entries

After the submit button is pushed:

  1. The name field is checked for content
  2. The e-mail address field is checked for at least 1 character on each side of an @ symbol
  3. The phone field is checked for at least ten integers
  4. If an error is found an error message is displayed.
  5. After the error dialog box is dismissed the first field with an error is then selected for correction.
  6. If there is no error a thank you dialog box is displayed. (Navigation to any page after this can be added.)