Recently I needed to allow users to check all checkboxes in a given section or the entire page. This is really easy to do with jQuery so let’s get to the sample:
Check All on this page
|
|
||||||||||||||||||||
Here are the basics of the code:

The implementation can be done inline (as I did) or by creating an event handler via $(Document).ready();
The key points with the code is how the selectors grab the correct checkboxes to check/uncheck. The top checkbox grabs all of the checkboxes on the page and the inner checkbox grabs all of the checkboxes that are contained within the specified table. Once the checkboxes have been found their status is set to the status of the checkbox being used (all or section only).