here is the script that works but I would need to enter about 500 if else statements and the same number of totals[*]. Is there a way I can shorten the script?
---------------------------------------------
function total() {
var totals = new Array();
if (document.total.pic1001){
totals[1] = document.total.pic1001.value;
}else{
totals[1] = "0";}
if (document.total.pic1002){
totals[2] = document.total.pic1002.value;
}else{
totals[2] = "0";}
if(document.total.pic1003){
totals[3] = document.total.pic1003.value;
}else{
totals[3] = "0";}
document.total.ordertotal.value = (totals[1])*1 + (totals[2])*1 + (totals[3])*1;
}
-----------------------------------------
thanks paul
---------------------------------------------
function total() {
var totals = new Array();
if (document.total.pic1001){
totals[1] = document.total.pic1001.value;
}else{
totals[1] = "0";}
if (document.total.pic1002){
totals[2] = document.total.pic1002.value;
}else{
totals[2] = "0";}
if(document.total.pic1003){
totals[3] = document.total.pic1003.value;
}else{
totals[3] = "0";}
document.total.ordertotal.value = (totals[1])*1 + (totals[2])*1 + (totals[3])*1;
}
-----------------------------------------
thanks paul