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.
Restaurant Menu
$4.49 Cheeseburger
$5.99 Bacon Cheeseburger
$2.99 Large Fries
$4.99 Chilli Cheese Fries
$1.99 Small Fountain Drink
$2.99 Large Fountain Drink
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started