117
rated 0 times
[
123]
[
6]
/ answers: 1 / hits: 31294
/ 13 Years ago, thu, july 14, 2011, 12:00:00
I have a table with checkboxes and I want to do the check all and un-check all checkboxes but I could not find the way to check all the checkboxes.
Here is my code:
<form>
<?php foreach ($this->entries as $entry): ?>
<tr class=table_head_seperator>
<td class=grid_info width=32px bgcolor=#f6f6f6><input type=checkbox class=chk_boxes1 name=to_delete[<?PHP echo $entry['id'] ?>] /></td>
<td class=grid_info width=160px bgcolor=#eeeeee><span class=country_name><?php echo $entry['user_name'] ?></span></td>
<td class=grid_info width=130px bgcolor=#eeeeee><span class=country_name><?php echo $entry['date_created'] ?></span></td>
<td class=grid_info width=100px bgcolor=#f6f6f6><span class=country_name><?php echo $entry['user_type_name'] ?></span></td>
</tr>
<?PHP endforeach; ?>
<input type=checkbox class=chk_boxes label=check all />check all
<input type=checkbox class=unchk_boxes /> un-check all
</form>
<script type=text/javascript>
$(document).ready(function() {
$('.chk_boxes').click(function(){
$('.chk_boxes1').attr('checked',checked)
})
});
</script>
More From » php