Homework 4
Homework 4
Due: Monday, February 11, 11:59:59 pm
Create a Webpage with an order form. Include at least three items to purchase, along with
shipping or billing information. The following are required:
- Use an image rollover somewhere in your page.
- Use Javascript to check the validity of the a 5-digit "zip code" field included in the shipping or billing information section, and make sure
1. that there are enough digits in the field,
2. that there are only numbers in the field
Give the user a warning via alert() if the data is not correct. The validation should be triggered by the onChange or onSubmit attributes. If you use the [string].length and parseInt([string]) methods, your requirement is fulfilled, but you are welcome to try something more fancy.
- Allow for the purchase of your items. (One of your fields must show the price.)
Provide a field where the quantity can be entered. Use Javascript to compute the total number of items and the total cost. The result should appear in two readonly text input fields. The totals should be calculated by clicking on a button (provide one that says "Calculate Total"). Make sure that the user doesn't enter a negative number and gets money back from you. (It is assumed that all numbers are integers. If the number is negative, turn it into a positive one. No further validation is required.)
Put this assignment in ~you/html/homework/hw4 and name it index.html