Ecco che siamo al punto.
La somma la esegue, ma viene fatta sulle stringhe, non sui valori numerici.
Il tutto e` impostato in modo da lavorare sulle stringe, non sui numeri.
Vedi questa modifica:
codice:
function showpicks() {
var s = 0;
if (document.exf1.c1.checked) s += 1;
if (document.exf1.c2.checked) s += 2;
if (document.exf1.c3.checked) s += 3;
if (document.exf1.c4.checked) s += 4;
if (document.exf1.c5.checked) s += 5;
if (document.exf1.c6.checked) s += 6;
document.exf1.t1.value = s;
}
Ma io preferirei mettere tutto in un loop:
codice:
function showpicks() {
var s = 0;
for (var i=1; i<=6; i++) {
if(document.exf1.elements['c'+i].checked) s += i;
}
document.exf1.t1.value = s;
}
Ciao
Michele