How can I get the parent in the asp:CustomValidator javascript function
<p>How can I get the parent in the asp:CustomValidator javascript function so that I can used it to check whether the related checkbox have been checked?</p>

<p>Example:</p>

<p>I have the following code:</p>

<pre><code>        &lt;tr&gt;   
            &lt;th class="graytext r"&gt;Add Reps to Team:&lt;/th&gt;
            &lt;td&gt;           
             &lt;asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="EmployeeID"
                    DataSourceID="dsEmployees" EnableViewState="false"
                    GridLines="None" CssClass="clGridDirectory"&gt;
                    &lt;Columns&gt;
                      &lt;asp:TemplateField &gt;
                        &lt;ItemTemplate&gt;
                          &lt;asp:CheckBox runat="server" ID="employee_name" CssClass="employee_name" Text='&lt;%# Eval("fullname") %&gt;'/&gt; 
                          &lt;asp:HiddenField runat="server" ID="employeeidToRep" Value='&lt;%# Eval("employeeid") %&gt;'/&gt;

                          &lt;asp:TextBox runat="server" ID="repID" Text='&lt;%# Eval("rep_id") %&gt;'  /&gt;

                            &lt;asp:CustomValidator id="CustomValidator2" runat="server" 
                              ControlToValidate = "repID"
                              ErrorMessage = ""
                              ClientValidationFunction="test" &gt;
                            &lt;/asp:CustomValidator&gt;
                        &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                    &lt;/Columns&gt;
                  &lt;/asp:GridView&gt;       
               &lt;asp:SqlDataSource ID="dsEmployees" runat="server" ConnectionString="&lt;%$ ConnectionStrings:TestConnectionString %&gt;"
                    SelectCommand="app_staff_without_team_select" SelectCommandType="StoredProcedure"&gt;
              &lt;/asp:SqlDataSource&gt;        
            &lt;/td&gt;
        &lt;/tr&gt;
</code></pre>

<p>Jquery code:</p>

<pre><code>function test(oSrc, args) {

    var $tb = $('input[id$=employee_name]');
    // only validate if an &lt;asp:Checkbox&gt; called chkOtherCheckbox is ticked
    alert(args.Value.toString())
    if ($('input:checkbox[id$=chkOtherCheckbox]').is(':checked'))
        alert('checked')
    else
        alert('no checked')

}
</code></pre>

<p>How can I get the parent in the test function so that I can used it to check whether the related checkbox have been checked?</p>
