Kindly help me in this problem-
I have been adding dynamic checkboxes associates with the records got fetched from database.I have a checkbox so that selecting it make all other dynamic checkboxes selected.
here is snippet-
$('# tbl_A').on("click",".chk_all",function(event){ //chk.all is the class of //select all checkbox
if($(this).checked) {
$('.chk_cls_candidate').each(function(){//.chk_cls_candidate refers to class of other dynamically generated checkbox
$(this).checked=true;
});
}
else
{
});
But the code is not working.
Please help.
More description about the problem-
I have generated checkboxes on the fly with the records I am fetching with the database.Those ch eckboxes has been given a class name so that i could be able to access them to perform some operation.I am also generating a checkbox on the fly which has a different class name say chk_all. Now I want to select all those chekboxes with the classname chk_cls_candidate when I click the checkbox with the class name chk_all.