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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please help everyone

    please help thanks in advanced

    this i want i am already using on the total box


    Code:
    function calculate() 
    
    {
    A = document.order.one.value
    B = document.order.two.value
    C = document.order.three.value
    
    D = document.order.four.value
    
    E = document.order.zero[0].value
    F = document.order.zero[1].value
    G = document.order.zero[2].value
    H = document.order.zero[3].value
    I = document.order.show1.value
    J = document.order.show2.value
    
    
    
    
    
    
    A = Number(A)
    B = Number(B)
    C = Number(C)
    D = Number(D)
    E = Number(E)
    F = Number(F)
    G = Number(G)
    H = Number(H)
    I = Number(I)
    J = Number(J)
    
    
    
    
    
    if(document.order.zero[0].checked){
    E = (E * A);
    }
    else
    
    
    if(document.order.zero[1].checked){
     E = (F * B) 
    
    }
    
    else
    
    if(document.order.zero[2].checked){
     E = (G * C) 
    }
    
    else
    
    if(document.order.zero[3].checked){
     E = (H * D) 
    
    }
    
    
    
    if(document.order.pay[0].checked && (E > 0 && E <= 20) )
    {
    	alert("£5.00 Dilivery Charges Added, your grand total is : \n £5 + " + E + " = " + "£" +(5+E));
    	document.order.totalcost.value = E + 5;	
    }
    
    else
    
    
    if(document.order.pay[0].checked && (E > 0 && E >= 20) )
    {
    	alert("*Free Delivery To YOur Door* \n\n Your Grand Total is  = " + "£" + (E));
    	document.order.totalcost.value = E;	
    }
    
    else
    
    
    if(document.order.pay[1].checked && (document.order.pay[0].checked== 0 && (E > 0 && E >= 20  )) )
    
    
    {
    
     (confirm("*You are entitled to free delivery would you like Free Delivery* \n\n Your Grand Total is   "+ "£"+ (E)));
    { 
    document.order.pay[0].checked = 1;
     
        }
      }
    else
    
    
    
    if(document.order.pay[1].checked && (E > 0 && E <= 20))
    { 
    	alert("                                         *Thank You* \n\n                  Collect Your own Pizza From Quick Pizzas\n\n *Please check the Contact page if you are not sure where we are based*")
    
    
    }
    else
    
    
    {
    document.order.totalcost.value = E	
    }
    
    }
    now i want it to add up the check box checked in extra toopings eash might have a value of 37p but should work in this way :Code:
    <script>
    Code:
    i want to add somtig  like this 
    <script>
    
    function ckbox(obj)
    {
    if(obj.checked)
    
    {alert("37p added to your value!")}
    
    else
    {alert("37p deducted from your total price!")}
    }
    </script>
    </head>
    <body>
    <form name="myform">
    <input type="checkbox" name="ck1" onClick="ckbox(this)">
    </form>
    </body>
    </html>
    then add it or deduct from the total box

    this is somthing that took me a long time to do aswell but just if it might help you thats how i want it to add up or deduct from the price please can u help me if you just show me one example it will be great i then can do the rest my self so it actually changes the price up and down wen chekced and unchecked please help

  • #2
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Try this for starters:

    http://www.codingforums.com/postguide.htm - #1 & #2
    Last edited by ArcticFox; 12-11-2006 at 01:16 AM.
    <div> - putting your mind in a box since 1997


  •  

    Posting Permissions

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