Hope someone can help. I currently have a check all checkboxes link on my page. Maybe I am being dense but I would like to add a link to uncheck all checkboxes, how do I go about doing this. Here is the code I have for checking all checkboxes: How would I clear all checkboxes using the second Clear All onclick event.
//Check all checkboxes
$('#form').click( function() {
$('input', oTable.fnGetNodes()).attr('checked','checked');
return false; // to avoid refreshing the page
} );
HTML form:
<form id="form">
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="verifyWrapper"> </td>
<td class="verifyButtons"><span class="button"><a title="Verify All" href="#" onclick="$(this).closest('form').click()">Check All</a>
</span>
</td>
<td class="verifyButtons"><span class="button"><a title="Clear All" href="#" onclick="">Clear All</a>
</span>
</td>
</tr>
</table>
</form>
//Check all checkboxes
$('#form').click( function() {
$('input', oTable.fnGetNodes()).attr('checked','checked');
return false; // to avoid refreshing the page
} );
HTML form:
<form id="form">
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="verifyWrapper"> </td>
<td class="verifyButtons"><span class="button"><a title="Verify All" href="#" onclick="$(this).closest('form').click()">Check All</a>
</span>
</td>
<td class="verifyButtons"><span class="button"><a title="Clear All" href="#" onclick="">Clear All</a>
</span>
</td>
</tr>
</table>
</form>