How to get unchecked multiple checkboxes values in jquery

I need a jQuery selector to fetch all the checkboxes in a page. I've got no results so far. Can anyone give me the right selector please? My jquery code:

function show_MemberCheckboxes(vall) {
    alert(vall);
    if($('#status_chechk_'+vall).is(':checked')){
        $('input:checkbox[name=subject_'+vall+']').attr('checked',true);
        var arr = [];
        i = 0;    
        $('#subject_'+vall+':checked').each(function(){
            arr[i++] = $(this).val();
        });        
        alert(arr);
    }
    else {
        var arrr = [];
        i = 0;    
        $('#subject_'+vall+'not:checked').each(function(){
            arr[i++] = $(this).val();
        });        
        alert(arrr);
        $('input:checkbox[name=subject_'+vall+']').attr('checked',false);
    }
}

My first checkbox code:

<input type="checkbox" name="status_chechk" id="status_chechk_<?php echo $i;?>" value="" onclick="show_MemberCheckboxes('<?php echo $i; ?>');"/>

my other check boxes loop,actually I want to get these checkboxes values.

<input type="checkbox" name="subject_<?php echo $i; ?>" value="<?php echo $posts_1->id; ?>" id="subject_<?php echo $i; ?>" onclick="show_SubjectCheckboxes('<?php echo $i; ?>');" <?php if (in_array($posts_1->id, $array) AND in_array($date, $datearr)){ echo 'CHECKED';} ?>

Answers


Without seeing your code, try this:

$("input:checkbox:not(:checked)")

Need Your Help

customevalidator is not working as expected during validation

c# asp.net validation customvalidator

Hi I am validating the textbox against checkbox checked state using custom validator..

Query on local database file without sqlite

c# database sqlite

Is there any way to connect a database file in .net4 without using SQLite external dll?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.