- 1

My code doesn't work

<html> <head> <title>Add two numbers</title> <h1>Denny’s restaurant </h1> </head> <body> <script language="javascript" type="text/javascript"> function submitform() { var input = document.forms.orderform.input.value; var age = document.forms.orderform.age.value; var side = document.getElementsByName("side"); var sidestring = ""; var sidenum = 0; var ticker = 0: for (j = 0; j < side.length; j++) { if (side[j].checked === true) { sidenum++; } } for (i = 0; i < side.length; i++) { if (side[i].checked === true { sidestring += (side[i].value); ticker++; if (ticker < (sidenum - 1)) { sidestring += ", "; } else if (ticker === (sidenum - 1)) { sidestring += ", and "; } } } if (input === "") { alert("Please enter a selection for your breakfast."); } else if (sidestring === "") { alert("You ordered the " + input + " with me sides from the " + age + " menu. Your order will be ready under 10 minutes."); } else if(input != "" && sidestring != "") { alert("You orde

3rd Jun 2018, 3:44 AM
Eilia Zandi
Eilia Zandi - avatar
4 Respuestas
+ 3
Post the code in the playground. just add the url in a comment. or use the plus to add the saved code.
3rd Jun 2018, 4:14 AM
Manual
Manual - avatar
- 1
if (input === "") { alert("Please enter a selection for your breakfast."); } else if (sidestring === "") { alert("You ordered the " + input + " with me sides from the " + age + " menu. Your order will be ready under 10 minutes."); } else if(input != "" && sidestring != "") { alert("You ordered the " + input + "with" + sidestring + " as sides from the " + age + "menu. Your order will be ready in under 7 minutes."); } else { alert("An Error happened. Please wait while we reload the page."); window.location.reload(true); document.body.bgColor='yellow'; } if(input !="") { alert("Thank you for ordering from Denny’s!"); <form name="contestform document.body.bgColor='yellow' } } function alertfuntion(){ var checkbox = document.getElementsById('Juice'); if(checkbox.checked === true) { alert('Out of Stock. Please choose something else.'); checkbox.checked = false; } } </script> <br><br><br><br> <form name="orderform"> <h3>Your breakfast selection: <h3> <ul> Cereals:<input type="checkbox" name="order" id="Cereals" value="Cereals"/><br> stewed Fruits:<input type="checkbox" name="order" id="stewed Fruits" value="stewed Fruits"/><br> SANDWICH:<input type="checkbox" name="" id="SANDWICH" value="SANDWICH"/><br> Nuetella:<input type="checkbox" name="order
3rd Jun 2018, 4:05 AM
Eilia Zandi
Eilia Zandi - avatar
- 1
here is the rest of the code
3rd Jun 2018, 4:05 AM
Eilia Zandi
Eilia Zandi - avatar
- 1
ok thank you
3rd Jun 2018, 4:14 AM
Eilia Zandi
Eilia Zandi - avatar