JSFiddle - React, Tailwind, and code Playground
HTML
<center>
<img src="images/pizza.jpg" width="15%">
<form name="orderForm">
<select name = "selMenu">
<option value = " ">Pick from the list below</option>
<option value = "Pepperoni and Cheese">Pepperoni and Cheese</option>
<option value = "Cheese Pizza">Cheese Pizza</option>
<option value = "White Pizza">White Pizza</option>
<option value = "Chicken Wing Pizza">Chicken Wing Pizza</option>
<option value = "Garlic crusted Pizza">Garlic crusted Pizza</option>
</select>
<center>
<table border="1">
<tr>*There will be a 0.08% sales tax added to each order*</tr>
<tr>
<td>Quantity: <input type="text" name="txtQuantity"></td>
<td>Price: <input type="text" name="txtPrice"></td>
</tr>
<tr><td><input type = checkbox value = "Add Tomato" name = chkTomato>Add Tomato</td>
<td><input type = checkbox value = "Extra Cheese" name = chkECheese>Extra Cheese</td></tr>
<tr><td><input type = checkbox value = "No Cheese" name = chkNCheese>No Cheese</td>
<td><input type = checkbox value = "No Sauce" name = chkSauce>No Sauce</td></tr>
<tr><td><input type = checkbox value = "Add Sausage" name = chkSausage>Add Sausage</td>
<td><input type = checkbox value = "Add " name = chkCrust>Cheesy Crust</td></tr>
<tr><td><input type = checkbox value = "Garlic Bread" name = chkBread>Garlic Bread</td>
<td><input type = checkbox value = "Blue cheese" name = chkBCheese>Blue Cheese</td></tr>
<th colspan="2">PAYMENT TYPE</th>
<tr><td><input type = "radio" name = radMoney value = "cash">Cash</td>
<td><input type = "radio" name = radMoney value = "visa">Visa</td></tr>
<tr><td><input type = "radio" name = radMoney value = "mastercard">MasterCard</td>
<td><input type = "radio" name = radMoney value = "discover">Discover</td></tr>
</table>
<center><textarea name="txtSummary" cols="40" rows="10"></textarea></center>
<input type="button" value="Process" onClick()="process()">
<input type="button" value="Clear" onClick()="clear()">
</form>
</center>
JavaScript
var name = prompt("Please enter your name")
var id = prompt(name + ", please enter your Employee ID number")
var oDate = Date()
var item = document.orderForm.selMenu.value;
alert("Hello " + name + "\n" +
"Employee #" + id + "\n" +
"Have a great day at Pizza Shack!")
var money = " "
for (i = 0; i<= 3; i++) {
theOption = document.orderForm.radMoney[i];
if(theOption.checked == true){
money = theOption.value;
}}
function process() {
var descript = " ";
if(document.orderForm.chkTomato.checked == true){
descript += document.orderForm.chkTomato.value;
descript += ", ";
}
if(document.orderForm.chkECheese.checked == true){
descript += document.orderForm.chkECheese.value;
descript += ", ";
}
if(document.orderForm.chkNCheese.checked == true){
descript += document.orderForm.chkNCheese.value;
descript += ", ";
}
if(document.orderForm.chkSauce.checked == true){
descript += document.orderForm.chkSauce.value;
descript += ", ";
}
if(document.orderForm.chkSausage.checked == true){
descript += document.orderForm.chkSausage.value;
descript += ", ";
}
if(document.orderForm.chkCrust.checked == true){
descript += document.orderForm.chkCrust.value;
descript += ", ";
}
if(document.orderForm.chkBread.checked == true){
descript += document.orderForm.chkBread.value;
descript += ", ";
}
if(document.orderForm.chkBCheese.checked == true){
descript += document.orderForm.chkBCheese.value;
descript += ", ";
}
var quantity = eval(document.orderForm.txtQuantity.value);
var price = eval(document.orderForm.txtPrice.value);
var tax = 0.08;
var total = (quantity * price) * tax;
var summary = "Customer Ordered: " + item;
summary += "Prepared with: " + descript;
summary += "Quantity order: " + quantity;
summary += "Cost of order: $" + cost;
summary += "Total cost of order with tax: $" + total;
summary += "Customer is paying with " + money;
summary += oDate;
document.orderForm.txtSummary.value =...