\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?> CS-090.3 Assignment 5

Introduction

For this assignment, you are to verify that the user has entered a valid Queens College email address on the start page.

Project Description

Call Core.preventDefault() to prevent the form from being submitted if the user tries to submit the form without entering a valid QC email address. Use a regular expression to test the information the user entered in the form to see if it is valid or not.

For this assignment define a valid email address as one that contains any mix of one or more word (\w) and dot (\.) characters followed by an at sign (@), followed by any number of word characters followed by either qc.edu or qc.cuny.edu. The address may have any number of whitespace characters (\s) before and after the email address, but nothing else. Neither the username (the part to the left of the @) nor the hostname (the part to the right of the @) may begin or end with a dot.

If the email address is valid, the action page should display the user’s email address in the text of a paragraph, just as it did in Assignment 4.

If the email address is not valid, provide visual feedback to the user that the field is invalid, such as by giving it a red border, and put the keyboard focus inside it.

Each time the submit handler is invoked, remove any error indicator from the field to let the user know that their input has not been re-evaluated yet.

Submit the Assignment

When you have tested your web pages, send me an email message to me saying your assignment is ready; I will get a copy from your account on the server and check it out. Send your email to:

Christopher.VickeryATqc.cuny.edu

Be sure the Subject Line of your email says CS-90.3 Assignment 5, just like that, to be sure your message does not get trapped by my spam filters.

Be sure to sign your email so I can tell who sent it!