How to select all values of checkbox when selectAll is selected?
<p>I am trying to get all the id values of the selected checkboxes. When the user hits "selectAll", all the checkboxes are checked, but I just can't get their individual value. Any idea what I am doing wrong?</p>

<p>Here is the jQuery:</p>

<pre><code>        $(".selectAll").unbind("click").click(function(e){//needs work here
        var bool = $(this).is(":checked"); //gets whether selected or not
        var list = new Array();

        $(function(){
            $("input:checkbox").attr("checked", bool);

            if(bool == true){
            $.each((".delID :checked"),function(){
                list.push( $(this).val());
                alert( $(this).val());
            }); }
        });
    }); //END of needs work area.
</code></pre>

<p>and here is the html:</p>

<pre><code>&lt;form name="selectDelete" class="selectDelete"&gt;
&lt;table id="inboxTable" class="txt13" width="800px"&gt;
&lt;tr&gt;&lt;th align="left" style="text-decoration:underline"&gt;&lt;input type="checkbox" name="selectAll" class="selectAll"/&gt;&lt;/th&gt;
    &lt;th style="text-decoration:underline"&gt;To&lt;/th&gt;&lt;td width="20px"&gt;&lt;/td&gt;
    &lt;th style="text-decoration:underline"&gt;Subject
    &lt;/th&gt;&lt;td width="20px"&gt;&lt;/td&gt;
    &lt;th style="text-decoration:underline"&gt;Date&lt;/th&gt;&lt;td width="20px"&gt;&lt;/td&gt;
    &lt;th style="text-decoration:underline"&gt;Action&lt;/th&gt;&lt;/tr&gt;

&lt;?php while($info=mysql_fetch_array($result)){
    $id = $info['id']; ?&gt;

    echo "&lt;tr&gt;
            &lt;td width="20px"&gt;&lt;input type="checkbox" name="delID" class="delID" value="'.$id.'"/&gt;&lt;/td&gt;";
</code></pre>

<p>Just for anybody out there with similar problems, this is what I ended up doing to make the code work:</p>

<pre><code>                if(bool == true){
            $(".delID").each(function(index,element){ 
                //list.push( $(this).val());
                alert(index + " " + $(this).val());
            }); }
</code></pre>

<p>In my case, if 'bool == true', then all the checkboxes will ALWAYS be checked, so that's why using just .delID, instead of .delID :checked worked for me. 
Thanks to all for the input.</p>
