checking one checkbox checks all the checkbox in an array
<p>I want to check all the other checkboxes if one checkbox is checked. My checkbox is an array. If one checkbox is checked i want all the checkbox in that row to be checked. My code </p>

<pre><code>&lt;tr&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportModuleName" runat="server" name="report"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="particulrs"&gt;&lt;/td&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportAdd" runat="server" name="reports"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportEdit" runat="server" name="reports"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportDelete" runat="server" name="reports"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportView" runat="server" name="reports"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="small"&gt;
    &lt;asp:CheckBox ID="chkReportPrint" runat="server" name="reports"&gt;&lt;/asp:CheckBox&gt;
  &lt;/td&gt;
  &lt;td class="othr"&gt;
    &lt;span&gt;&lt;input type="checkbox" id="chkReportActivity1" name="reports" /&gt;&lt;/span&gt;
  &lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>On check of the checkbox named report.I want to check all the checkboxes with the name reports. The checkbox chkReportModuleName is an array. When it is clicked i want only the checkboxes in that row to be checked.</p>

<p>The jquery which i have tried is as follows:</p>

<pre><code> $('input[name="ctl00$MainContent$chkTransModuleName"]').click(function () {
   $('input[name="trans"][i]').attr("checked", this.checked);
   $('input[id="MainContent_chkTransAdd"]').attr("checked", this.checked);
   $('input[id="MainContent_chkTransEdit"][i]').attr("checked", this.checked);
   $('input[id="MainContent_chkTransDelete"][i]').attr("checked", this.checked);
   $('input[id="MainContent_chkTransView"][i]').attr("checked", this.checked);
   $('input[id="MainContent_chkTransPrint"][i]').attr("checked", this.checked);
 });
</code></pre>

<p>It runs but i want the only those checkboxes to be checked which are in that row.</p>

<p>Can someone please help me with this?
Thanks</p>
