I want to remove runners, age, favourite from the code but still want it to calculate correctly.
How do I do this without affecting the code: here is the code so far.
function track(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case 'Sedgefield' :
oneone.value='2';
onetwo.value='5';
onethree.value='3';
onefour.value='5';
onefive.value='1';
onesix.value='5';
twoone.value='2';
twotwo.value='2';
twothree.value='1';
twofour.value='2';
twofive.value='3';
twosix.value='2';
perc.value='8.75';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function ty(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case 'Handicap':
oneone.value='2';
onetwo.value='3';
onethree.value='2';
onefour.value='3';
onefive.value='3';
onesix.value='3';
twoone.value='4';
twotwo.value='0';
twothree.value='4';
twofour.value='1';
twofive.value='2';
twosix.value='1';
perc.value='10';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function going(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case 'Soft':
oneone.value='2';
onetwo.value='3';
onethree.value='2';
onefour.value='4';
onefive.value='1';
onesix.value='4';
twoone.value='2';
twotwo.value='2';
twothree.value='2';
twofour.value='1';
twofive.value='2';
twosix.value='1';
perc.value='7.5';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function cl(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case '1':
oneone.value='3';
onetwo.value='2';
onethree.value='2';
onefour.value='4';
onefive.value='2';
onesix.value='4';
twoone.value='2';
twotwo.value='3';
twothree.value='3';
twofour.value='1';
twofive.value='2';
twosix.value='1';
perc.value='7.5';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function distance(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case '12f':
oneone.value='0';
onetwo.value='4';
onethree.value='0';
onefour.value='5';
onefive.value='0';
onesix.value='5';
twoone.value='3';
twotwo.value='2';
twothree.value='3';
twofour.value='1';
twofive.value='2';
twosix.value='0';
perc.value='7.5';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function runners(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case '5':
oneone.value='3';
onetwo.value='6';
onethree.value='3';
onefour.value='6';
onefive.value='2';
onesix.value='7';
twoone.value='5';
twotwo.value='2';
twothree.value='5';
twofour.value='2';
twofive.value='6';
twosix.value='1';
perc.value='10';
break;
case '10' :
oneone.value='2';
onetwo.value='1';
onethree.value='1';
onefour.value='2';
onefive.value='1';
onesix.value='2';
twoone.value='1';
twotwo.value='2';
twothree.value='1';
twofour.value='0';
twofive.value='1';
twosix.value='0';
perc.value='3.75';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function age(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case '3':
oneone.value='2';
onetwo.value='3';
onethree.value='2';
onefour.value='5';
onefive.value='2';
onesix.value='4';
twoone.value='3';
twotwo.value='2';
twothree.value='1';
twofour.value='0';
twofive.value='1';
twosix.value='1';
perc.value='7.5';
break;
case '7':
oneone.value='0';
onetwo.value='2';
onethree.value='1';
onefour.value='1';
onefive.value='0';
onesix.value='2';
twoone.value='1';
twotwo.value='1';
twothree.value='1';
twofour.value='2';
twofive.value='3';
twosix.value='1';
perc.value='3.75';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
function favourite(el,oneone,onetwo,onethree,onefour,onefive,onesix,twoone,twotwo,twothree,twofour,twofive,twosix,perc){
switch(el.value){
case '3/1':
oneone.value='0';
onetwo.value='0';
onethree.value='1';
onefour.value='0';
onefive.value='1';
onesix.value='0';
twoone.value='5';
twotwo.value='2';
twothree.value='3';
twofour.value='3';
twofive.value='3';
twosix.value='3';
perc.value='6.25';
break;
default:
oneone.value='';
onetwo.value='';
onethree.value='';
onefour.value='';
onefive.value='';
onesix.value='';
twoone.value='';
twotwo.value='';
twothree.value='';
twofour.value='';
twofive.value='';
twosix.value='';
perc.value='';
break;
}
total();
}
/* Totals */
function total(){
var t11 = document.getElementsByClassName("FTw1"),
t12 = document.getElementsByClassName("FBw1"),
t13 = document.getElementsByClassName("FTp1"),
t14 = document.getElementsByClassName("FBp1"),
t15 = document.getElementsByClassName("FTt1"),
t16 = document.getElementsByClassName("FBt1"),
t21 = document.getElementsByClassName("FTw2"),
t22 = document.getElementsByClassName("FBw2"),
t23 = document.getElementsByClassName("FTp2"),
t24 = document.getElementsByClassName("FBp2"),
t25 = document.getElementsByClassName("FTt2"),
t26 = document.getElementsByClassName("FBt1"),
tperc = document.getElementsByClassName("perc"),
t1 = document.getElementById("FTw1").value,
t2 = document.getElementById("FBw1").value,
t3 = document.getElementById("FTp1").value,
t4 = document.getElementById("FBp1").value,
t5 = document.getElementById("FTt1").value,
t6 = document.getElementById("FBt1").value,
tt1 = document.getElementById("FTw2").value,
tt2 = document.getElementById("FBw2").value,
tt3 = document.getElementById("FTp2").value,
tt4 = document.getElementById("FBp2").value,
tt5 = document.getElementById("FTt2").value,
tt6 = document.getElementById("FBt2").value,
ttperc = document.getElementById("perc").value,
s11 = "FTw1",
s12 = "FBw1",
s13 = "FTp1",
s14 = "FBp1",
s15 = "FTt1";
s16 = "FBt1";
s21 = "FTw2",
s22 = "FBw2",
s23 = "FTp2",
s24 = "FBp2",
s25 = "FTt2";
s26 = "FBt2";
sperc = "perc";
sum(t11,t1,s11);
sum(t12,t2,s12);
sum(t13,t3,s13);
sum(t14,t4,s14);
sum(t15,t5,s15);
sum(t16,t6,s16);
sum(t21,tt1,s21);
sum(t22,tt2,s22);
sum(t23,tt3,s23);
sum(t24,tt4,s24);
sum(t25,tt5,s25);
sum(t26,tt6,s26);
sum(tperc,ttperc,sperc);
}
function sum(c,t,s){
t = '0';
for(var i = 0; i < c.length; i++){
var a = c[i].value,
b = 1*a+1*t;
t = b;
document.getElementById(s).value = t;
}
}