Reputation: 1734
I am a little bit confused with Jquery .selectable. What I need to do, is to make an area that contains checkboxes to be selectable (I'm ok up to here) and then check which of the selected checkboxes are already checked (so I can uncheck them), of check them if they are not.
$("#calContainer").selectable({
filter: 'checkbox',
selected: function(event, ui) {
// need code for:
// for every checkbox in selected area thats is checked, uncheck
// for every checkbox in selected area thats is not checked, check
}
});
Any help is appreciated. Thanks.
Upvotes: 1
Views: 4331
Reputation: 171669
I would suggest wrapping your checkboxes in labels
Here's a working demo
Upvotes: 6
Reputation: 150263
I never heard of selectable
plugin, but to get the checked checkboxes:
$('input[type="checkbox"]:checked')
Upvotes: 1