DuffeyP
asked on
Checkbox JavaScript
I have the following script where one checkbox selects a column of radio buttons (Radio0) and another de-selects it. I would like to combine these into a single checkbox where checking selects and unchecking de-selects it.
Here is the JS code I have now.
<script>
//Check all radio/check buttons script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
function checkall(formname,checknam e,thestate ){
var el_collection=eval("docume nt.forms." +formname+ "."+checkn ame)
for (c=0;c<el_collection.lengt h;c++)
el_collection[c].checked=t hestate
}
</script>
And here is the code for the 2 checkboxes that select the column of radios. I would like to combine these into a single checkbox that both selects and de-selects.
<input type="checkbox" name="All" value="0" onClick="javascript:checka ll('thefor m','Radio0 ',true)">
<input type="checkbox" name="All" value="0" onClick="javascript:checka ll('thefor m','Radio0 ',false)">
Here is the JS code I have now.
<script>
//Check all radio/check buttons script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
function checkall(formname,checknam
var el_collection=eval("docume
for (c=0;c<el_collection.lengt
el_collection[c].checked=t
}
</script>
And here is the code for the 2 checkboxes that select the column of radios. I would like to combine these into a single checkbox that both selects and de-selects.
<input type="checkbox" name="All" value="0" onClick="javascript:checka
<input type="checkbox" name="All" value="0" onClick="javascript:checka
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome and thanks for the points
ASKER