Question: Javascript - For this assignment we will be creating a Restaurant Order Form. I have created the basic page, along with some sample code to

Javascript - For this assignment we will be creating a Restaurant Order Form. I have created the basic page, along with some sample code to get you started.

You will need to complete the functions to Toggle the Fries and Drinks sections by adding or removing the 'hide' CSS class I created. I have already created the function to Toggle Burgers and you can use that as an example to build out the full functionality. I have also made created the function to reset the form.

Finally, to calculate the total, you will need to get the value of each checked checkbox and add to a variable that you can display at the end. You can do that the same way we have gotten values from input boxes in past assignments. See the below line for an example.

document.getElementById('burger_1').value

HINT: When you calculate the total, you should consider that a user could uncheck an categories checkbox without unchecking the items within, i.e. They may uncheck Burgers without unchecking Cheeseburger. We should assume that if the main category is unchecked, they do not want an item within it. What that means for you, is that you should use a nested IF statement to first check if a category is checked at all, and then if so, add any checked items under it to your total.

Week 12 & 13 Programming Assignment

Restaurant Menu

Burgers
$3.99 Hamburger
$4.49 Cheeseburger
$5.99 Bacon Cheeseburger
Fries
$1.99 Small Fries
$2.99 Large Fries
$4.99 Chilli Cheese Fries
Drinks
$0.99 Water
$1.99 Small Fountain Drink
$2.99 Large Fountain Drink
Total:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!