Jump to content

artlake

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by artlake

  1. I need a function to calculate the total price of these items and display the results

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>pizza</title><style></style><script type="text/javascript">function check(size){document.getElementById("answer").value=size}function createOrder(){pizza=document.forms[0].pizzatxt=""for (i=0;i<pizza.length;++ i){if (pizza.checked){txt=txt + pizza.value + " "}}document.getElementById("order").value="You ordered a pizza with " + txt}</script></head><body><form> Pizza <p>Select size and toppings then click total </p><br> <input type=radio name="size"onclick="check(this.value)" value="small">small $8<br> <input type=radio name="size"onclick="check(this.value)" value="medium">medium $12<br> <input type=radio name="size"onclick="check(this.value)" value="large">large $16<br><p>Size <input type="text" id="answer" size="6"></p> <p>add $1 for each topping</p><input type="checkbox" name="pizza" value="extra cheese">extra cheese<br /><input type="checkbox" name="pizza" value="pepperoni">pepperoni<br /><input type="checkbox" name="pizza" value="sausage">sausage<br /><input type="checkbox" name="pizza" value="mushrooms">mushrooms<br /><br> <input type="button" onclick="createOrder()" value="Send order"><br /><br /><input type="text" id="order" size="70"></form> </body></html>
  2. pizza.htmlI am looking for an example so tha I can complete an assignment in a client and server side scripting class that I am taking. I need to be able to add totals of the prices of the check boxes and radio buttons on this page and display the results. The part that is completed is from the W3schools tutorial. I need to finish this so I can move onto a php assignment.
×
×
  • Create New...