what is wrong in my code. i want that when user click on check hyperlink then all option of checkbox list will be checked and when click again on the same link then all option of checkbox list will be uncheck. please guide me how to do it. thanks
UPDATE:
thanks for ur answer but i am not talking about check rather checkbox list what has many checkbox inside.it looks like....he i am giving the html of checkboxlist
mou_inn
Participant
783 Points
964 Posts
check uncheck all checkbox of checkboxlist using jquery ASP.Net
Mar 02, 2012 01:27 PM|LINK
i was trying to check uncheck all option of checkboxlist programmatically but my code is not working. here is snippet
$(document).ready(function () {
$('#myLink').click(function () {
$("INPUT[id^='chkFileds']").attr('checked', $('#chkFileds').is(':checked'));
});
});
what is wrong in my code. i want that when user click on check hyperlink then all option of checkbox list will be checked and when click again on the same link then all option of checkbox list will be uncheck. please guide me how to do it. thanks
UPDATE:
thanks for ur answer but i am not talking about check rather checkbox list what has many checkbox inside.it looks like....he i am giving the html of checkboxlist
<table style="font-weight:bold;" id="chkCountry">
<tbody>
<tr>
<td>
<input type="checkbox" value="GB" name="chkCountry$0" id="chkCountry_0">
<label for="chkCountry_0">UK</label>
</td>
<td>
<input type="checkbox" value="US" name="chkCountry$1" id="chkCountry_1">
<label for="chkCountry_1">USA</label>
</td>
</tr>
</tbody>
</table>
daisydain
Member
222 Points
51 Posts
Re: check uncheck all checkbox of checkboxlist using jquery ASP.Net
Mar 02, 2012 01:30 PM|LINK
Hello,
Try out the link below
http://stackoverflow.com/questions/6168479/check-uncehck-checkboxlist-with-jquery
bhaskar.mule
Contributor
2280 Points
659 Posts
Re: check uncheck all checkbox of checkboxlist using jquery ASP.Net
Mar 02, 2012 01:30 PM|LINK
hi
i hope it will help you
http://praveenbattula.blogspot.in/2009/09/checkuncheck-all-checkboxes-in-jquery.html
Site:Rare technical solutions
Allen Li - M...
Star
10411 Points
1196 Posts
Re: check uncheck all checkbox of checkboxlist using jquery ASP.Net
Mar 04, 2012 02:16 AM|LINK
Hi, you can refer to the following link:
http://forums.asp.net/p/1772512/4848290.aspx/1?Re+How+to+check+all+chek+boxs+depend+of+Parent+checkbox
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
ashish-1983
Contributor
4869 Points
1257 Posts
Re: check uncheck all checkbox of checkboxlist using jquery ASP.Net
Mar 04, 2012 09:49 AM|LINK
http://viralpatel.net/blogs/2010/11/multiple-checkbox-select-deselect-jquery-tutorial-example.html
This will resolve your issue and it delivers better output.
hope that helps
Gridview
Jquery
Asp.net
Fun !