Professional Documents
Culture Documents
INSTRUCTION: Modify your Cake Order Form exercise. Save your files in a zip file,
<surname>_ex11.zip (e.g. trese_ex11.zip). Submit your work on Google classroom and turn it in. Write
your name, section, and code description on the upper part of your document. Do not forget to
document your work.
Modify your Cake Order Form to do the following (add appropriate HTML/JS code):
● Compute the total cost of making the cake. The cake cost is computed as the total of each cake tier
cost.
π * radius**2 * 5 * cake_multiplier
where
radius = 2,3,4,5,6 (tier1 has radius 2, tier2 has radius 3, and so on, respectively)
cake_multiplier = the total from the cake flavor, filling, icing, inside cake additions, decorative
additions, and liquid infusion
● Add an option for store pickup or delivery. Delivery Address, preferred delivery date, and preferred
delivery time should be disabled when store pickup is selected (it should be selected by default).
Enable these when Delivery is selected. These should be disabled once Store Pickup is selected
again. Add a delivery fee.
● Add additional form validation:
Make sure that the preferred delivery date is in the future. Show a message if it's not (remove the
message upon selecting a valid date).
Preferred delivery time should only be between 6am to 6pm. Show a message if it's not (remove
the message upon selecting a valid time).
● Show a summary of the order after a successful submit (using an alert). Add the following code to
prevent the page from reloading after a submit (make sure to put it at the end of the <body>, in
this example, "form" is the id of the form).
● Tips:
If you need to convert a value to a number, you can use parseInt().
You can use Date.parse(<Date>) to convert the Date into a number.
See what the onChange() event does!