This assignment involves validating form data. Although HTML5 has some validation built-in
now, it is not fully suppoorted in all browsers, and this assignment requires you to
use regular JavaScript functions without regular expressions or HTML5 to do the validation.
Program Specifications
Create a web page with a nicely laid-out form containing fields for
name, age, zipcode, telephone number, and password. Include reset and
submit buttons. Use JavaScript functions to validate the form fields when
the form is submitted. If the form validates, send the form data to
http://kermit.kishwaukeecollege.edu/~dklick/dataChecker.php.
as a POST request. You should get a response that tells you if the data you sent is valid.
Of course, your validation routine could still be incorrect if you haven't tested enough
possibilities or your validation routine is excluding some correct answers from being sent.
The names of the text input elements should be name, age,
zip, phone, and pass. The exact names
are important since that is what the receiving page will be expecting.
Display form validation error messages either below the form or to the right of each input field.
Display ALL error messages instead of stopping when the first error is encountered.
All form fields should be required.
The name field must be non-blank.
The age field must be a valid integer between 16 and 120. To check for being an integer, create and use
a JavaScript function [named something like isInteger()]. If it is a valid integer, then check the range of
ages using regular if statements [eg. if (age >= 16)].
The zipcode field should allow the following formats:
#########
#####
#####-####
##### ####
The phone number should allow the following formats:
an optional area code which must be a 3 digit number not starting with a zero;
it may be followed by an optional space or dash
a seven digit number, of which the first may not be a zero; there may be an
optional dash after the third digit
The password field must be between eight and sixteen characters long, and include at least one
lowercase letter, one uppercase letter, one digit, and one character which is not a letter, digit,
or whitespace character.
If there are any validation errors, then display all of them and do not let the form be submitted.