Dr. Garrett's Student Website
School of Business
Eastern Illinois University

Project 6

For this project you will be creating the following files:

  • Proj6.html
  • Proj6.js
  • Proj6Submit.html

Proj6.html

This file will contain a form for street, city, state, country, and zip.  There will also be a submit button and a "Clear Form" button.  The submit button will submit the form after validating that there is something written in each field.

Validation that there is text in each field (non-null) must be accomplished with an include in the <head> like this:

<script type="text/javascript" src="Proj6.js"></script>

The file being pointed to (Proj6.js) will contain the functions needed for validation.

Proj6.js

This is a javascript file.  It will contain two functions:

  • checkform()
  • clearform()

The checkform() function will check each field in the form to make sure there are no fields left blank.  If there is a field left blank, a message box will appear indicating that a certain form field has not been filled out (see sample).

The clearform() function will place nulls in each of the fields to reset the form.

Proj6Submit.html

This page will contain a simple message to indicate that the form submission has taken place.  There will be no actual form submission.  Instead, the submit button will call this file (as long as the checkform() function returns a true).

You will also need to include a link back to Proj6.html here.

Sample

I will demonstrate this project in class.

Submitting the Files

  1. Place your files on the class server
  2. Make sure that your Project 6 link on your projects page points to Proj6.html in that folder.

Files must be uploaded no later than 8:59 a.m. on the due date.

Extra Credit

If you have everything else working, you can get 15 points extra by substituting Proj6Submit.php for Proj6Submit.html.  For this, you would capture the data that has been entered and display it on the page.