Get the values of all checked check boxes and put them in a hidden field
<p>How do I modify this simple check all code to get all the values of the checkboxes after they are checked and then place them into hidden input, each value should be separated with a comma so I can then explode the values in php. The checkboxes are inside table rows</p>

<pre><code>//checks all and unchecks all checkboxes based on checkbox in first row of the table.
 $('th input:checkbox').click(function(e) {
    var table = $(e.target).parents('table:first');
    $('td input:checkbox', table).attr('checked', e.target.checked);

 });
</code></pre>
