Solved

pizza website solution

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

746 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

9 Experts available now in Live!

Get 1:1 Help Now