Solved

pizza website solution

Posted on 2007-03-27
3
271 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now