Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set checkbox from checkboxlist to uncheck using jquery

how to set one checkbox from asp.net checkboxlist control to unchecked where the index of the selected check box is i using jquery.

like image 962
Eyla Avatar asked Dec 28 '22 16:12

Eyla


1 Answers

If I understand you, you should be able to do something like:

$('input:checkbox').eq(i).removeAttr('checked');

To set it, you would use:

$('input:checkbox').eq(i).attr('checked','checked');

Note that the initial selector will get all the checkboxes on the page. If you need to restrict it to just a subset of checkboxes on the page, adjust the initial selector -- based on a container or the naming scheme for the checkboxes - to deal with just the checkboxes in question. I'm also assuming that you're using zero-based indexing for the checkbox in question.

like image 55
tvanfosson Avatar answered Jan 16 '23 03:01

tvanfosson