Raihan
Raihan

Reputation: 4001

How to Check if all Check-boxes are Unchecked with jQuery icheck plugin.

In Short I want to Check if all check-boxes on my table are Unchecked. If yes I will perform an action.

But I am using jQuery iCheck plugin and I didn't find/understand how to do this. They have couple of Call Backs and Methods but I am not sure how to use this to check if all my check boxes are unchecked.

Wanting your kind help anyone familiar with this plugin. Thanks in advance.

Upvotes: 0

Views: 2814

Answers (1)

dm4web
dm4web

Reputation: 4652

http://jsfiddle.net/koa58o4o/10/

$('.select-users').on('ifUnchecked', function (event) {
    //counts the number of selected check-boxes
    // if count=0 hide div
    if ($('.select-users:checked').size() == 0) 
        $('.block').hide();
});

Upvotes: 7

Related Questions