How to Check the checkbox when all the checkboxes in a row are checked?

Posted by SoftwareNerd on Stack Overflow See other posts from Stack Overflow or by SoftwareNerd
Published on 2012-12-01T04:53:52Z Indexed on 2012/12/01 5:03 UTC
Read the original article Hit count: 92

Filed under:

Hi all How can i check the checkbox when all the other checkboxes in a row are checked what i mean is i have a div table which looks like this

<div id="Row-8">
    <span class="span2">
        <label class="checkbox">
            <input type="checkbox" class="regular-checkbox" onchange="checkallrowcheckboxes(this)" value="8" name="selectedObjects" id="8"><label for="rowcommoncheckbox-8"></label></label></span>
    <span class="span2">AddOrEdit</span>
    <span class="span2">
        <label class="checkbox">
            <input type="checkbox" value="8" class="regular-checkbox" name="chkAdd" id="Add-8"><label for="Add-8"></label></label></span>
    <span class="span2">
        <label class="checkbox">
            <input type="checkbox" value="8" class="regular-checkbox" name="chkEdit" id="Edit-8"><label for="Edit-8"></label></label></span>
    <span class="span2">
        <label class="checkbox">
            <input type="checkbox" value="8" class="regular-checkbox" name="chkDel" id="Delete-8"><label for="Delete-8"></label></label></span>
    <span class="span2">
        <label class="checkbox">
            <input type="checkbox" value="8" class="regular-checkbox" name="chkview" id="View-8"><label for="View-8"></label></label></span>
</div>

Which looks like this

ChkColumn  PageName Chk1 Chk2 Chk3 Chk4

what i want is when all the checkboxes in right side os row are checked the left side checkbox should be automatically checked..i.e Chkcolumn should be automatically checked when Chk1 Chk2 Chk3 Chk4 are chekced..

© Stack Overflow or respective owner

Related posts about jQuery