Solved

pizza website solution

Posted on 2007-03-27
3
274 Views
Last Modified: 2010-04-16
Please copy and paste the code I am working on it.
I am creating a website for a local pizza shop. I need help to create the javascript  calculator.
(Party Pizza Specials)

5 types of pizza

Large Pizza $7.99

Large Pan Pizza $8.99

Medium Pizza : $5.99

Medium Pan Pizza: $6.99

Small Pizza: $3.99

I want my customer to select the Pizza type from drop down menu and enter the numbers of pizzas
The total price should for each pizza type should be shown in the text fields.
Here is the form

Select the Pizza Type: drop down menu (five choices)  
Quantity:______(enter the number of pizza)
Enter: button

Total Price of Large Pizza:___________(text field which display the total price of selected pizza types)
Total Price of Large Pan Pizza:___________(text field which display the total price of selected pizza types)
Total Price of Medium Pizza:___________(text field which display the total price of selected pizza types)
Total Price of Medium Pan Pizza:___________(text field which display the total price of selected pizza types)
Total Price of small Pizza:___________(text field which display the total price of selected pizza types)



<********************************** Here is the Code****************************>


 <script language="javascript">
 
 function pizzaparty()
{
var pizzaLarge = document.myform.large.value
var pizzaCalc= (pizzaLarge * 7.99)
var pizzaTotalCalc= pizzaCalc + (pizzaCalc*0.045) ;

document.myform.ctemp.value = pizzaTotalCalc
}
 
 




</script>

            
<form name="myform">
<table border="1">
      <tr>
      <tr><td colspan="3"><h2>Party Pizza Special for Summer(May, Jun, July, August)</h2></td></tr>
            <td>Slect the pizza type</td>
            <td>
            <select name="pizza">
            <option value="5" >Large Pizza - $7.99</option>
            <option value="3" >Large Pan Pizza- $8.99</option>
            <option value="52" >Medium Pizza - $5.9</option>
            <option value="9" >Medium Pan Pizza - $6.99</option>
            <option value="8" >Small Pizza - $3.99</option>
            
            </select>
             </td>
            <td>Quantity<input type="text" name="large"><input type="button" value="Enter" onClick="pizzaparty()"></td>
      </tr>
      <tr>
            <td>Large Pizza(tax included)</td>
            <td><input type="text" name="largep"></td>
            <td>&nbsp;</td>
      </tr>
      <tr>
            <td>Large Pan Pizza</td>
            <td><input type="text" name="medium"></td>
            <td>&nbsp;</td>
      </tr>
      <tr>
            <td>Medium Pizza</td>
            <td><input type="text" name="mediump"></td>
            <td>&nbsp;</td>
      </tr>
      <tr>
            <td>MediumPan Pizza</td>
            <td><input type="text" name="small"></td>
            <td>&nbsp;</td>
      </tr>
      <tr>
            <td>Small Pizza</td>
            <td><input type="text" name="ctempbk"></td>
            <td>&nbsp;</td>
      </tr>
</table>

</form>

  </body>
0
Comment
Question by:sfareed
  • 2
3 Comments
 
LVL 15

Expert Comment

by:stanscott2
ID: 18804644
What is your question?
0
 

Author Comment

by:sfareed
ID: 18807597
this code is not working properly?
0
 
LVL 15

Accepted Solution

by:
stanscott2 earned 250 total points
ID: 18808179
Your Javscript references a form field "large"

In your HTML, the name of the form field is "largep"
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to dynamically set the form action using jQuery.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question