Hi!

The thing is that somwhow (don't ask me why) the unchecked attribute
of a checkbox is '' instead of 'false'.

This worked fine with me:
HTML:
<input class="parentcheckbox" type="checkbox" checked="true"
name="cb01"></input>
<input class="childcheckbox" type="checkbox" checked="true"
name="cb02"></input>
<input class="childcheckbox" type="checkbox" checked="true"
name="cb03"></input>
<input class="childcheckbox" type="checkbox" checked="true"
name="cb04"></input>

jQuery:
$(document).ready(function(){
        $('.childcheckbox').change(function(){
                $(this).prev('.parentcheckbox').attr('checked','');
        });
});


On Feb 12, 4:57 pm, Andy <adharb...@gmail.com> wrote:
> Hey guys,
>
> I'm trying to uncheck a checkbox that is inside my flexigrid.  I have
> a checkbox in the header and the column has all checkboxes.  What I'm
> trying to do is if I select the top checkbox (so all of the checkboxes
> below are selected), I would like to uncheck that checkbox if any of
> the other checkboxes in that column are unchecked.
>
> I'm using the following code, but when it runs through this, it
> unselects all of the items, instead of just the header.
>
> Code snippet:
> ================================================================
> var rItem = document.getElementById("chk_col_" + colName);
> $("inp...@name=" + rItem.name + "][type='checkbox']").attr('checked',
> false);
> ================================================================
>
> The checkbox is named correctly, so I'm not sure why this isn't
> working.
>
> Thanks!

Reply via email to