Introduction
This is an exercise in using JavaScript regular expresssions and using JavaScript to alter the appearance of a web page in response to user input.
The Assignment
Working from your existing project, update your submit listener so that it does the following:
- Prevent the form from submitting if the user-name is not a valid email address or if the password field is less than six characters long.
- If anything prevents the form from being submitted, highlight the offending input element(s) by making their backgrounds turn pink. Give the elements with valid values a light green background. Use the Core library addClass() and removeClass() functions to implement this.
- If the eamil address is a valid Queens College student email account, display an alert box just before the form is actually submitted. The message in the alert box is to say, “Hello, "I. Name"”, where I is the (capitalized) initial of the person’s first name, and Name is the person’s last name, properly capitalized.
- In the XHTML document, add the class, “required” to the label tags for the two input elements, and use CSS to append a red asterisk to all elements with the required class.
Submit The Assignment
When your assignment is working, log out and be sure your profile is copied back to the server. Send me an email message telling me that you have completed the assignment, and I will get a copy of it from your account on Oak for testing. If your roaming profile does not work, mention that in your email, and I will copy your My Website directory from your home directory instead of your profile directory on Oak.
- Be sure to put your name in your email message!
- The Subject line must be CS-90.3 Assignment 4 to avoid my spam filters.
- Send your email to either Christopher.VickeryATqc.cuny.edu or vickeryATbabbage.cs.qc.cuny.edu — but not to both.
- See the course syllabus for grading and late homework policies.