Objective
To practice forms, data validation, and animation.
Grading
- (30%) Service Form Implementation
- (10%) Service Form Generates Expected Server Confirmation
- (10%) Search Form Implementation
- (40%) JavaScript Support
- (10%) CSS Style
Overview
For this project you will implement a web page with a form that allows user
to apply for cable service. The data provided in the form needs to be validated
before it is sent to the server for processing. You do not need to provide
pseudocode for this project, but you are encourage to develop it for your own
benefit. The following files (project distribution) are associated with this project: Proj6.zip.
Specifications
You must define a form with the text fields and buttons you can see in the "Sample Run".
The "Payment Method" is a combo box with two options: "Credit Card" and "Bill me". A
second form will be used to define a search option (similar to one of the examples
discussed in class). The search option will use Google as the search engine.
The following provides additional information about this project:
- Your program will display the current time at the top of the form (as illustrated in the "Sample
Run" below)
- You should implement an animation that rotates between the four UMD images provided with the
project distribution. The images should be displayed at the top of the
page (as illustrated in the "Sample Run").
- Validation Requirements
- Your program must verify that a firstname, lastname, address, and e-mail have
been provided. You do not have to verify the format of the data (e.g.,
e-mail format). By the way, you can obtain the characters of a string by using
the charAt() function, where the argument is the index position of the character
in the string.
- Your program must verify that at least one service has been selected. If no service
has been selected your program must generate the message "No Service Selected".
- Your program must verify that at least one plan has been selected. If no plan
has been selected your program must generate the message "No Plan Selected".
- Your program must have as default payment "Bill me".
- Your program must verify that a valid credit card number has been provided.
A valid credit card number consists of four sets of digits, each with exactly
four digits. In addition, your form must only allow four digits for
each set of digits.If an invalid number has been provided your program
must generate the message "Invalid Credit Card Number"
- Your program must verify that a valid expiration date has been provided.
We consider valid dates those with month values between 1 and 12 and year
values greater than or equal to 2007. If an invalid date has been provided your program
must generate the message "Invalid Expiration Date"
- If after evaluating the data any errors are found, your program will not
submit the form and will display a single message (using alert) where
the fields with invalid data are identified. If the data is correct the form will
be submitted. The following image (InvalidData) illustrates how the message will look like if we
have invalid values for all of our fields.
- Search Form Requirement - It should define a local search (based on www.umd.edu) and a web search.
- Functions Requirement
- It is up to you to define any functions you need, however, you must have at least
two functions. All functions should be in the file named cable.js
- You should avoid duplicating code. That is, if you
have the same code segment in many functions, you
should create a function for the common code.
- Style Requirement
- The service request form must have a gradient background based on
the provided gradientImg.jpg file.
- The style and appearance of your page should be very close to what you
see in the "Sample Run".
- Server Processing
- The form data will be sent to the cableProcessing.php script found at
the following address:
http://www.turtle.cs.umd.edu/classes/cmsc198NSpr07/cableProcessing.php
- You will use get as the submission method.
- The names to use for form fields are: firstname, lastname, address, email,
cable, internet, phone, plan, payment, firstFourDigits,
secondFourDigits, thirdFourDigits, fourthFourDigits,
month, year, and comments
- The values associated with cable, internet and phone fields are cable,
internet, and phone, respectively.
- The values associated with plan are oneYearPlan, twoYearPlan, otherPlan.
- The values associated with payment are creditCard and billMe.
- The link Sample Server Script Execution illustrates an example of submitting data to the script. From
this example you should derive the names to use for the form entries.
Additional Requirements
Sample Run
The service request video illustrates the functionality associated with
the service request form. Also, you can find a snapshot of the web page in
WebPage. For better results use QuickTime as your player.