Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urget help please, i beg you, its serious :<

    Pizza ordering project, a minute of help please. urget
    hi guys, if u can help me i would be glad so much, its final day and i have a project i need to send, though i have stucked in 1 simple problem.

    i have a pizza online order project, basically u choose what pizza u want , how many and u can see the price in the end. the problem i face is that when i choose more than one pizza, the total price isn't changed, and it remains to one pizza's price. You can see the code below, please help me if u can guys..
    this is the code

    Code:
    <html>
    
    
    	<head>
    		
    		<meta http-equiv="Content-Type"
    		content="text/html; charset=iso-8859-7">
          </script>
    		
    <SCRIPT LANGUAGE="JavaScript">
    
    var list=new Array();
    var i=0;
    
    
    
    
    function fasi(){
    
    	var price1=7.99;
    	var price2=0;
    	
    	if(document.form.type.value=="Margarita")price1=6.99;
    	if(document.form.type.value=="Classic")price1=8.99;
    	
    	if(document.form.sidide.value=="Medium")price2=2;
    	if(document.form.sidide.value=="Large")price2=3;
    	
    	var total=(price1+price2)*1.23;
    	total=Math.ceil(total * 100) / 100 ;
    	document.form.soul.value=total;
    	
    	
    	
    	
    	
    }
    
    function order(){
    	
    list[i]=new Object();
    list[i].type=document.form.type.value;
    list[i].quan=document.form.quan.value;
    list[i].crus=document.form.crus.value;
    list[i].sidide=document.form.sidide.value;
    list[i].namesr=document.form.namesr.value;
    list[i].address=document.form.address.value;
    list[i].soul=document.form.soul.value;
    i++;
    
    content();
    
    
    }
    
    function cancel(){
    
    
    
    list.splice(0,i);
    i=0;
    content();
    
    }
    function content(){
    
    document.form.adds.value = "";
    for(var b=1;b<i;b++){
    	addtext(b+")  "+list[b].type+", "+list[b].quan+", "+list[b].crus+" "+list[b].sidide+", "+list[b].namesr+", "+list[b].address+" ->"+" "+list[b].soul+" Ευρώ \n");
    }
    
    if(i==0){
    		document.getElementById("olaboum").disabled =true;
    		document.getElementById("ade geia").disabled =true;
    	}
    if(i!=0){
    		document.getElementById("olaboum").disabled=false;
    		document.getElementById("ade geia").disabled =false;
    	}
    
    
    }
    
    
    function addtext(add) {
    
    
    	
    	document.form.adds.value += add;
    	
    
    
    
    }
    
    function deletacione(){
    
    var id=document.form.idprosdiagrafi.value;
    list.splice(id,1);
    i--;
    
    content();
    
    }
    
    
    </script>
    	
    	<style type="text/css">
    	#apDiv1 {
    	position:absolute;
    	width:304px;
    	height:270px;
    	z-index:1;
    	left: 179px;
    	top: 90px;
    }
        #apDiv2 {
    	position:absolute;
    	width:200px;
    	height:115px;
    	z-index:1;
    	left: 233px;
    	top: 88px;
    }
        </style>
    	</head>
    
    	<body  background="menu-free-background.png" onLoad="fasi();">
    	
    		<form name="form">
    		
    		<div class="class1">
    		  <p>&nbsp;</p>
    		  <p><br>
    	      </p>
            </div>
    				
    		<div class="stiqueeeeee">
    		
    	
    		<div class="stique">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type of pizza:
    		  <select name="type" id="type" onChange="fasi();">
    		    <option value="Margarita">Margarita</option>
    		    <option value="Bacon">Bacon</option>
    		    <option value="Vegetarian">Vegetarian</option>
    		    <option value="Classic">Classic</option>
    	      </select>
    		  <p>
    	   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Quantity:
    	    <input size="15" type="text" name="quan" id="quan">
    	    <p>
    		 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &Kappa;&rho;&omicron;ύ&sigma;&tau;&alpha;:
    <select name="crus" id="crus">
    	    <option value="λεπτή" selected>Λεπτή</option>
    		    <option value="χοντρή">Χοντρή</option>
    		    <option value="Κλασσική">Κλασσική</option>
            </select>
    		  <p>
    		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size:
              <select name="sidide" id="sidide" onChange="fasi();">
    	    <option value="Small">Small</option>
    	    <option value="Medium" selected>Medium</option>
    		    <option value="Large">Large</option>
    	      </select>
    		  <p>
    		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name:
              <input name="namesr" type="text" id="namesr" size="25">
    		  <p>
    		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;address :
              <input name="address" type="text" id="address" size="35">
    		  <p>
    		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total price:
              <input name="soul" type="text" disabled id="soul" size="5">
              &euro;
    		  <p>          
    		  <p></div>
    <p>&nbsp;</p>
    </div>
    		<div class="adds">
    		  <textarea id="adds" name="adds" rows="10" cols="80" wrap="off" disabled>
    			 
    		  </textarea>
    		</div>
    			
    	
    		<div class="troll">
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="Submit"  onclick="order();"> 
    			  <input name="deletecioneduo" id="deletecioneduo" type="button" value="Delete all" onClick="cancel();">
    		  </p>
    		  <p>&nbsp;</p>
    		</div>
    		
    		
    		
    		<div class="braton">
    			
    			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="ade geia" id="ade geia" type="button" value="Delete specific number" onClick="deletacione(document.form.idprosdiagrafi.value);">
    		  </p>
    			<p>
    			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input size="5" type="text" name="idprosdiagrafi" id="idprosdiagrafi">
    		  </p>
    			</p>
    		</div>
    		
    		
    		
    		
    		
    
    		</form>
    </body>
    
    
    </html>

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,928
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    First, read the forum rules, specifically rule 1.5.

    Then, did it ever occur to you to look at a JS console?

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    The first thing I noticed is a closing </script> tag at the beginning with no opening <script> tag.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    And <script language=javascript> is long deprecated and obsolete. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9).

    Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •