When designing a webpage with list of checkbox items, it is common and useful to implement a Select All/None function so that the user can easily select/unselect all items with a single mouse click.
Let's say, we have 3 sets of item as below:
You can use separate FORM for each of the sets, and use FORM ID to distinguish each of the FORM. Each FORM will need to handle their own SUBMIT action separately.
If the different sets are within the same FORM and share the same SUBMIT action, you can make use of CLASS name in their CHECKBOX elements to distinguish and separate out the sets.
and below is the HTML BODY part of the sample webpage (click the image to enlarge it):
Set 1 is in separate FORM from Set 2 and Set 3 with a different FORM ID. Note that even though Set 1 and Set 2 are both using the same CHECKBOX CLASS name, their checkboxes will can be selected all/none separately.
Set 2 and Set 3 are within the same FORM. We can still separate them by using different CHECKBOX CLASS names.