PDA

shaz1987
12-10-2006, 03:09 PM

this i want i am already using on the total box

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) )
{
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>

i want to add somtig like this
<script>

function ckbox(obj)
{
if(obj.checked)

else
}
</script>
<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

ArcticFox
12-10-2006, 06:57 PM
Try this for starters:

http://www.codingforums.com/postguide.htm - #1 & #2