Solved

pizza website solution

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to dynamically set the form action using jQuery.

772 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