Saturday, 31 August 2013

HTML checkbox when select all tick doesn't show

HTML checkbox when select all tick doesn't show

<table class="list" id="example">
<thead>
<tr>
<td class="first" width="1" style="text-align: center;"><input
type="checkbox"
onclick="$('input[name*=\'selected\']').attr('checked',
this.checked);"></td>
<td class="left">
Username
</td>
<td class="left">
Status
</td>
<td class="left">
Date Added
</td>
<td class="right">
Action
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><input type="checkbox"
name="selected[]" value="2">
</td>
<td class="left">testing</td>
<td class="left">Enabled</td>
<td class="left">31/08/2013</td>
<td class="right"> [ <a href="">Edit</a> ]</td>
</tr>
<tr>
<td style="text-align: center;"><input type="checkbox"
name="selected[]" value="1">
</td>
<td class="left">admin</td>
<td class="left">Enabled</td>
<td class="left">31/03/2013</td>
<td class="right">[ <a href="">Edit</a> ]</td>
</tr>
</tbody>
</table>
I got a checkbox when click will select all others checkbox, the first
time click the select all, others check box will checked shown tick. But
When uncheck the select all and select it again, the others checkbox
doesn't shown tick but when view source code checked="checked" does shown

No comments:

Post a Comment