I have amount of checkboxes. For Example 100; I need to choose 20, different checkboxes. When I will check 20 ChB, I would like to disable checking any other boxes, but enable to uncheck cheked boxes. Is it real? I know IDs of all checked boxes. How can i do this by JQuery?
function PageSelected(sender) {
selectedIds = [];
var enough = 0;
$('input[type=checkbox]').each(function () {
if (avblPagesCount <= selectedIds.length) {
$('#'+sender.id).attr("checked", false);
}
if (avblPagesCount > selectedIds.length) {
if(this.checked) {
selectedIds.push(this.id);
}
}
});
};