title: How to disable the parent check box if all other checkbox in the repeater is disabled using jquery
body: <p>May be i am dumb or new to this please give me a solution .I have a repeater in which i am disabling the repeater check boxes from code behind by checking a condition in the item data bound .So if all the check box is disabled i want the main header check box also disabled .</p>
  
  <p>I tried this but failed </p>
  
  <pre><code> $(document).ready(function () {
  
          if ($('#All input:checkbox').attr('disabled')) {
              $('#SelectAll').attr("disabled", true);
          }
              });
  </code></pre>
  
  <p>If all check box in the div #ALL disabled i want the check box "SelectAll" disabled </p>
  
  <pre><code>&lt;asp:Repeater ID="AutoPublishList" runat="server" EnableViewState="true"&gt;
                      &lt;HeaderTemplate&gt;
                          &lt;td id="RemoveHead" runat="server"&gt;
                              &lt;input type="checkbox" id="SelectAll" runat="server" clientidmode="Static" /&gt;
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick=" Sort('ProductName');"&gt;
                              Manager/Product
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('PageID');"&gt;
                              Page
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('IsPreliminary');"&gt;
                              Prelim
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('LastSaved');"&gt;
                              Last Updated
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('PublishDate');"&gt;
                              Time Published
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('ErrorDisplay');"&gt;
                              Errors
                          &lt;/td&gt;
                          &lt;td class="sortableHeaderSmall" onclick="Sort('Comment');"&gt;
                              Comments
                          &lt;/td&gt;
                      &lt;/HeaderTemplate&gt;
                      &lt;ItemTemplate&gt;
                          &lt;tr&gt;
                              &lt;td id="RemoveCell" runat="server" style="" class="sortableBodySmall"&gt;
                                  &lt;div id="All"&gt;
                                      &lt;input type="checkbox" id="SelectRow" runat="server" value=' &lt;%#DataBinder.Eval(Container, "DataItem.ProductID")%&gt;' /&gt;
                                      &lt;asp:HiddenField runat="server" ID="pageIDHidden" Value='&lt;%#DataBinder.Eval(Container, "DataItem.PageID")%&gt;' /&gt;
                                      &lt;asp:HiddenField runat="server" ID="FirmID" Value='&lt;%#DataBinder.Eval(Container, "DataItem.FirmID")%&gt;' /&gt;
                                  &lt;/div&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="left"&gt;
                                  &lt;a class="primaAnchor" href='&lt;%# String.Format("/pg/imq/mf/index.aspx?fid={0}&amp;pid={1}", Eval("FirmID"),Eval("ProductID")) %&gt;'
                                      target="_blank"&gt;
                                      &lt;asp:Literal EnableViewState="False" ID="ProductName" runat="server" Text='&lt;%#DataBinder.Eval(Container, "DataItem.ProductName")%&gt;' /&gt;
                                  &lt;/a&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="left"&gt;
                                  &lt;a class="primaAnchor" href='&lt;%# String.Format("/pg/imq/imqpage{0}.aspx?fid={1}&amp;pid={2}",Eval("PageID"), Eval("FirmID"),Eval("ProductID")) %&gt;'
                                      target="_blank"&gt;
                                      &lt;asp:Literal EnableViewState="False" ID="PageName" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem,"PageName")%&gt;' /&gt;&lt;/a&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="center"&gt;
                                  &lt;asp:Literal EnableViewState="False" ID="IsPreliminary" runat="server" Text=' &lt;%# IIf(DataBinder.Eval(Container.DataItem, "IsPreliminary") = True, "P", "")%&gt; ' /&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="right" style="width: 105px"&gt;
                                  &lt;asp:Literal EnableViewState="False" ID="LastSaved" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "LastSaved")%&gt;' /&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="right" style="width: 105px"&gt;
                                  &lt;asp:Literal EnableViewState="False" ID="PublishDate" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "PublishDate")%&gt;' /&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="left" style="width: 105px"&gt;
                                  &lt;asp:Literal EnableViewState="False" ID="ErrorDisplay" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "ErrorDisplay")%&gt;' /&gt;
                              &lt;/td&gt;
                              &lt;td class="sortableBodySmall" align="left"&gt;
                                  &lt;asp:Literal EnableViewState="False" ID="Comment" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "Comment")%&gt;' /&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/ItemTemplate&gt;
  </code></pre>