Assignment 3
Forms and Form Validation
Marks will be awarded for completing each of the following tasks:
- (30%) Take the web page found here and place the form elements
in a table so they look neater. See Exercise 8 for ideas.
- (20%) Ensure that your page correctly validates using the W3.org validation service at http://validator.w3.org.
- Use form validation to ensure the following conditions are met:
- (10%) Name is required and must only contain letters, dashes, spaces and full stops -
e.g Mr. Jean-Bosco Mudereva.
- (10%) Password fields are both required. Password must contain only letters or numbers (in any combintation),
must be at least 3 characters in length, and both passwords must be exactly the same.
- (10%) Email Address must contain:
- At least one letter or digit for the user name - if username is more than one character long it may also include dashes, underscores and full-stops.
- The @ symbol
- A domain name containing at least one character followed by a full-stop and then at least one other character.
- Valid addresses to test:
- martin@classaxe.com
- martin-francis_23@hotmail.co.uk
- Invalid addresses to test:
- .@.
- martin
- martin@
- @email
- @email.com
- martin@.com
- martin@email.
- (5%) Date of Birth fields are optional, but if any are set they must ALL be set and must contain only numbers.
Make sure day is between 1 and 31, month is between 1 and 12 and year is between 1900 and 1999 using whatever technique works best for you.
- (10%) A Province must be selected. If the selection is 'Other', an entry must be made in the 'Other' field. This entry may comprise only of letters and spaces.
- (5%) Telephone number fields are optional, but if any are set they must ALL be set and must contain only numbers
- Only if all conditions are met can the form be processed and sent, otherwise the user must see a message telling them which field or fields were invalid.
- Place your completed page in your user directory (see Assignment 2 for details on how to do this) and ensure that it is named assign_3.html
- Complete by: 9am, Tuesday 14th October, 2003