CSCI 351: Internet Programming
Assignment 8. Due: Sun, Jul 26
Please ZIP all your work in a single archive hw8.zip and upload it on Canvas by 11:59pm of the day above.
- (25 points)
Consider the following set of two lamps and a button:
Design a JavaScript for changing the color of the lamps. Starting with the color combination of two lamps (blue,blue), any button click must lead to the following color combinations repeated cyclically: (blue,red), (red,blue), (red,red), then again (blue,blue)...
Name your HTML file Lamps.htm - (15 points)
Your task is to design an online form for a software developing company
that would be used for registering the company products. The form should
request and be able to collect the following information from the
customers:
- First Name, Last Name
- Address line 1
- Address line 2
- City, State/Province, ZIP code
- Country
- Product (provide a selection list for 5-6 software products)
- Date purchased
- Used for (provide a way to check one of the following possibilities: Home, Business, Government, Education, Other)
- System (provide a way to select one or more of the following systems: Windows, Macintosh, Linux, Unix, Other)
- Comments (provide a text field for comments)
- Submit and reset buttons
The form elements should be nicely placed in the browser's window. It is up to you to decide what is nice but make sure to put some structure into your form.
Add the following form validation features:
- (5 points) Check for filling in the first and last name. Before sending the names to the server process them so that they would have the first capital letter and all the remaining letters are small.
- (5 points) Check for nonempty address line 1.
- (5 points) Check for filling in the city name. The name should start with a capital letter and have all other letters small.
- (5 points) State: check for two capital letters.
- (5 points) ZIP code: check for a positive number.
- (5 points) Country: same claim as for the city name.
- (5 points) Product: check that a product is selected.
- (5 points) Date purchased: check for a valid date.
- (5 points) Usage: check that something is selected.
- (5 points) System: make sure that something is checked. If the "other" option has been chosen, make sure that some system is filled out.
- (5 points) Comments: thank the user for comments, if such provided.
- (5 points) If the form data passed the control, this data has to be submitted for processing to the script running at URL http://cs2.uwsuper.edu/cgi-bin/sb/CheckData by using the POST method. You can figure out what data is actually submitted by checking the server response.
To complete the first task you will need the following images:
ballred.gif