Or this, if you want to count how many a[] and how many b[]
function check_counter(theBox){
var theForm = theBox.form;
var prefix = theBox.name.substring(0,th
var kk = 0;
for(i=0;i<theForm.elements
var elem = theForm.elements[i];
if(elem.type=='checkbox' && elem.name.indexOf(prefix+'
kk++;
}
}
document.sign_form.checks_
}
<input type="checkbox" name="a[21]" value="3" onclick="check_counter(thi
Main Topics
Browse All Topics





by: mplungjanPosted on 2007-07-12 at 23:41:54ID: 19478628
function check_counter(theForm){ .length;i+ +){ selected.v alue=kk;
s.form);> <<< notice this.form
var kk = 0;
for(i=0;i<theForm.elements
var elem = theForm.elements[i];
if(elem.type=='checkbox' && elem.checked){
kk++;
}
}
document.sign_form.checks_
}
<input type="checkbox" name="a[21]" value="3" onclick="check_counter(thi
Michel