Hello
I Have a problem.
I’ve searched all the check and uncheck buttons made from javascript but I have a different situation:
Given:
a.) 1 header checkbox [name=”chk”] (the check and unchecked button) – (if this checkbox is checked, all the other 10 buttons will be selected)
b.) 10 checkboxes [name=”checked”] (once all of this checkboxes are selected, the checkbox (A) of the header must be automatically enabled)
I have the following script for checkALL function:
[code=php]function checkAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == ‘checkbox’ && theForm[z].name != ‘checkall’){
theForm[z].checked = theElement.checked;
}
}
}
Question:
How can I recycle this script so that if all of my 10 checkboxes are selected, the header checkbox will be enabled?
Hope someone can help me on this. thank you!