hi
kinda new to javascript and have a bit of a problem
i've got kind of an order form at http://homepage.ntlworld.com/smogtastic/productform2.html, now the code i have so "price" automatticly updates when someone enters a number in "amount" code is under the cut
script type="text/javascript"
function Ladder1(oForm){
if(/^\d+$/.test(oForm.qp1.value) || oForm.qp1.value=="") {
oForm.one.value = oForm.up1.value*oForm.qp1.value;
}
else {
oForm.qp1.value="";
oForm.one.value = 0;
alert("Quantity must be a digit!");
}
}
function Ladder2(oForm){
if(/^\d+$/.test(oForm.qp2.value) || oForm.qp2.value=="") {
oForm.two.value = oForm.up2.value*oForm.qp2.value;
}
else {
oForm.qp2.value="";
oForm.two.value = 0;
alert("Quantity must be a digit!");
}
}
/script
now i dont know what to add so it can also automatticly updates a Total (inc Vat rate of 17.5%) as well (probably be best too see the link to know what i'm on about cos i'm crap at explaining things)
kinda new to javascript and have a bit of a problem
i've got kind of an order form at http://homepage.ntlworld.com/smogtastic/productform2.html, now the code i have so "price" automatticly updates when someone enters a number in "amount" code is under the cut
script type="text/javascript"
function Ladder1(oForm){
if(/^\d+$/.test(oForm.qp1.value) || oForm.qp1.value=="") {
oForm.one.value = oForm.up1.value*oForm.qp1.value;
}
else {
oForm.qp1.value="";
oForm.one.value = 0;
alert("Quantity must be a digit!");
}
}
function Ladder2(oForm){
if(/^\d+$/.test(oForm.qp2.value) || oForm.qp2.value=="") {
oForm.two.value = oForm.up2.value*oForm.qp2.value;
}
else {
oForm.qp2.value="";
oForm.two.value = 0;
alert("Quantity must be a digit!");
}
}
/script
now i dont know what to add so it can also automatticly updates a Total (inc Vat rate of 17.5%) as well (probably be best too see the link to know what i'm on about cos i'm crap at explaining things)
