New to javascript, my problem is effectively: I have a php page that produces a single form with multiple process blocks or sections each with a group of checkboxes
eg
<form action='./this.php' method='POST'>
One<br>
<input type='checkbox' name='one[part1]'>a<br>
<input type='checkbox' name='one[part2]'>b<br>
<input type='checkbox' name='one[part3]'>c<br>
<input type='checkbox' name='one[all]'>all<br>
<br>
Two<br>
<input type='checkbox' name='two[part1]'>a<br>
<input type='checkbox' name='two[part2]'>b<br>
<input type='checkbox' name='two[part3]'>c<br>
<input type='checkbox' name='two[all]'>all<br>
<input type='submit'>
</form>
Example problem: I want to be able to click on the two[all] checkbox and have two[part1],two[part2], and two[part3] all become checked.
If I name all the checkboxes in the group the same, the php post value will only show up for one, so I need to keep the names different.
Is there any simple method for doing this, short of dynamically(through php) producing separate onclick functions for each section.
Note, not all sections will be the same, sometimes one.part1 may not be available for checking but its information will be shown and the checkbox names will start from b onwards.
Or maybe traversing the DOM to find all checkboxes after a start marker and before the check all.
Hopefully that is clear enough.