I need a work-around (or new code) that will limit it to only check one group of boxes, perhaps by using a unique id for the input tag. (I tried adding
Expand|Select|Wrap|Line Numbers
- && x.form[i].id='formid'
My input tag's names are in an array ( cs[1], cs[2], cs[3]. . . . ). I use PHP.
Can anyone help me?
The code I tried is :
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- function selectAll(x) {
- for(var i=0,l=x.form.length; i<l; i++)
- if(x.form[i].type == 'checkbox' && x.form[i].name != 'sAll')
- x.form[i].checked=x.form[i].checked?false:true
- }
- </script>
- <input type=\"checkbox\" name=\"SalleSalle\" on click=\"selectAll(this)\" /> (Select all)<br />