title: What code do I need, to get the pizzas ordered from my array to reappear in a different function?
body: <p>What code do I need to put in, so that it will show what pizzas have been ordered. Like in the array.
  Down in the calculation function I have already got the customers name and number (and address) to show up as a receipt sort of thing. But I also need it to show what pizzas have been ordered.</p>
  
  <p>So I need the variable "fullorder" to show up again in the alert in the "calculation function" If that makes any sense.</p>
  
  <p>Sorry if this doesn't make a lot of sense. It is tuff trying to explain it.</p>
  
  <pre><code> totalNumber = 0;   // for total number of Pizzas ordered
   pizzaPrice = 9.50;   // price of each pizza
   pizzaPriceGourmet = 15.50;  //price for gourmet pizzas
   orderTotalPrice = 0;   // total cost of order
   pizzaDeliveryPrice = 5; // price for pizza delivery
   var customerName = prompt("Please enter your name.") //prompt to get the customers name
   var customerNumber = prompt("Please enter your phone number.") //prompt to get the customers number
  
  
  function order()
  {
    var pizza = new Array()
    pizza[0] = document.form.hawaiian.value                //allocates type of pizza in array
    pizza[0] = Number(pizza[0])                           //converts to number value
    pizza[1] = document.form.cheese.value                 //allocates type of pizza in array            
    pizza[1] = Number(pizza[1])                            //converts to number value
    pizza[2] = document.form.veggie.value                //allocates type of pizza in array
    pizza[2] = Number(pizza[2])                            //converts to number value
    pizza[3] = document.form.supreme.value                //allocates type of pizza in array
    pizza[3] = Number(pizza[3])                            //converts to number value
    pizza[4] = document.form.pepperoni.value                //allocates type of pizza in array
    pizza[4] = Number(pizza[4])                            //converts to number value
    pizza[5] = document.form.meatlovers.value                //allocates type of pizza in array
    pizza[5] = Number(pizza[5])                            //converts to number value
    pizza[6] = document.form.chicken.value                //allocates type of pizza in array
    pizza[6] = Number(pizza[6])                            //converts to number value
    pizza[7] = document.form.prawn.value                //allocates type of pizza in array
    pizza[7] = Number(pizza[7])                            //converts to number value
  
    totalPlain = pizza[0] + pizza[1] + pizza[2] + pizza[3] + pizza[4];
    totalGourmet = pizza[5] + pizza[6] + pizza[7];
  
    var totalNumber = totalGourmet + totalPlain
  
    var fullOrder = alert("You have ordered: " + "\n" +        
           "Hawaiian Pizza: " + pizza [0] + "\n" +
           "Cheese Pizza: " + pizza [1] + "\n" +
           "Veggie Pizza: " + pizza [2] + "\n" + 
           "Supreme Pizza: " + pizza [3] + "\n" +
           "Pepperoni Pizza: " + pizza [4] + "\n" +
           "Meat-Lovers Pizza: " + pizza [5] + "\n" +
           "Chicken Pizza: " + pizza [6] + "\n" +
           "Prawn Pizza: " + pizza [7]);  
  
  
    if (totalNumber &gt;12) {          // Limit for total amount of Pizzas ordered
        alert("There is a limit of 12 pizzas per order. - PRESS 'Prevent this page from creating     additional dialogs' THEN PRESS 'cancel order' AND THEN RE-ORDER! - Current total is: " +totalNumber);
    } else 
        alert("Total number of pizzas ordered: " + totalNumber); //Total amount of pizzas ordered
    calculate()  //Begins calculation function
  }
  
  
  function calculate()    //Function for the cost of the order
  {
      orderTotalPrice = (totalPlain*pizzaPrice + totalGourmet*pizzaPriceGourmet);  //order total+ amount of pizzas ordered * pizza price
      var pizzaDelivery = prompt('Would you like your order to be delivered for $5, or for pick up?    -Type in "1" for delivery, and "0" for pickup.') //asks if you want your order to be delivered or not
      orderTotalPrice = (orderTotalPrice + (pizzaDelivery*pizzaDeliveryPrice)); // calculates the total cost with or without the delivery cost
      alert("Total cost of pizzas is: $" + orderTotalPrice.toFixed(2) );  //Display order cost as "$"0.00
      if (pizzaDelivery == '1'){
          var response = prompt("Please enter your address: ")
          alert("The pizza should be delivered within the next 25 minutes, to this address:   " +response)
           alert("Thank you for ordering with Pete's Pizzas " +customerName)
           alert("If anything happens to go wrong we will contact you on your number: " +customerNumber)
           alert("Your order details are: " +customerName +"\n" +customerNumber +"\n" +response)
           alert("To exit, just click 'ok' and then close down the program!")
      } else if (pizzaDelivery == '0'){
           alert("Your order will be ready for pickup in 15 minutes!")
           alert("Thank you for ordering with Pete's Pizzas " +customerName)
           alert("If anything happens to go wrong we will contact you on your number: " +customerNumber)
           alert("Your order details are: " +customerName +"\n" +customerNumber)
           alert("To exit, just click 'ok' and then close down the program!")
      }
  }
  </code></pre>