Unit 4 Assignment 1 – Form Field Validation
and Error Messages
You have created a basic form and
information entered into your form fields. You will use the
"registration.html" file found in your Zip file. You will see that the
page has a form with the following fields to allow users to register for
an account. The items in parentheses are defined formatting instructions to be
observed for each field.
- Username* (must only contain letters and numbers) –
- Password* (minimum of 8 characters) – Required field
- PasswordVerify* (minimum of 8 characters, must match
password) – Required field
- FirstName* (text string) – Required field
- LastName* (text string) – Required field
- Email (uses email@example.com format)
- PhoneNumber (uses (xxx) xxx-xxxx format)
- SignUpNewsletter (radio box for yes/no)
Read the assignment overview.
Use the registration.html file to
write should validate each field and, if errors are made, display
appropriate error messages that direct the user to complete the form properly.
Once the form is completed, your script should open the confirmation page
and generates an appropriate error message if the field has not been
completed using best practices in error reporting that includes all
relevant error messages at once in an easy-to-read manner.
formatting definitions that the field values should be checked against
(found in the overview) after each field with regular expressions in the
most effective manner according to coding best practices.
correction message (next to the field) in the event a form entry error has
to the first erroneous input field while providing additional formatting
change to indicate the selected field to the user.
- Create a submit button that executes the validation
when submitted and runs error-free as the submit is overridden, producing
the confirmation.php message.