Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

MY TABLE:

<table id="DispalyTable" border="4px"  style="width: 100%;"  >
                        <tr>
                            <td style="width: 137px; height: 137px;" valign="top">
                                <telerik:RadGrid runat="server">
                                    <MasterTableView>
                                        <Columns>
                                            <telerik:GridTemplateColumn>
                                                <HeaderTemplate>
                                                    <asp:CheckBox runat="server" Checked="true" Text="ALL" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:CheckBox runat="server"  />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                            <td style="width: 130px;" valign="top">
                                <div>
                                    <input id="Alloption" type="checkbox" checked="checked" value="All" onchange="javascript:othercheckboxalloption();" style="color: Black" 
                                        /><span style="color: Black">All </span>
                                    <br />
                                    <input id="otherCheckbox2" type="checkbox" value="Accepted" style="color: Black"
                                        class="chkdisplay" onchange="javascript:othercheckbxdisplay();"  /><span style="color: Black">Accepted </span>
                                    <br />
                                    <input id="otherCheckbox3" type="checkbox" value="Contracted" style="color: Black"
                                        class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span style="color: Black">Contracted</span>
                                    <br />
                                    <input id="otherCheckbox4" type="checkbox" value="Pending" style="color: Black" class="chkdisplay"  onchange="javascript:othercheckbxdisplay();" /><span
                                        style="color: Black">Pending</span>
                                    <br />
                                    <input id="otherCheckbox5" type="checkbox" value="Pre-Authorized" style="color: Black"
                                        class="chkdisplay" onchange="javascript:othercheckbxdisplay();"  /><span style="color: Black">Pre-Authorized</span>
                                    <br />
                                    <input id="otherCheckbox6" type="checkbox" value="Show Deleted" style="color: Black"
                                        class="chkdisplay" onchange="javascript:othercheckbxdisplay();"  /><span style="color: Black">Show Deleted</span>
                                    <br />
                                    <input id="otherCheckbox7" type="checkbox" value="Treated" style="color: Black" class="chkdisplay"  onchange="javascript:othercheckbxdisplay();"  /><span
                                        style="color: Black">Treated</span>
                                    <br />
                                    <%-- <asp:CheckBox ID="All" runat="server" Checked="true" Text="ALL" ForeColor="Black"  /><br />

                                </div>
                            </td>
                            <td style="width: 138px;" valign="top">
                                <div>
                                    <asp:CheckBox ID="CheckBox8" runat="server" Checked="true" Text="Accepted" ForeColor="Black" /><br />
                                    <asp:CheckBox ID="CheckBox9" runat="server" Checked="false" Text="Appointment" ForeColor="Black" /><br />
                                    <asp:CheckBox ID="CheckBox10" runat="server" Checked="true" Text="Contract #" ForeColor="Black" /><br />
                                    <asp:CheckBox ID="CheckBox11" runat="server" Checked="true" Text="Pre-Auth #" ForeColor="Black" /><br />
                                    <asp:CheckBox ID="CheckBox12" runat="server" Checked="true" Text="TX Coloums" ForeColor="Black" /><br />
                                </div>
                            </td>
                            <td valign="top">
                                <div>

                                    <asp:DropDownList ID="DropDownList1" runat="server" >
                                        <asp:ListItem Text="Diag Date,Tth,Proc" Value="Diag Date,Tth,Proc"></asp:ListItem>
                                        <asp:ListItem Text="Tth,Diag Date,Proc" Value="Tth,Diag Date,Proc"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                    </table>

Code I Tried:

 function notewizardcheckbox() {
            $("#DispalyTable").attr("disabled", "disabled");
        }

control on which the above function is called, onchange event

<div style=" margin-left:25px; margin-top:17px; float:none;">
                <input id="Checkbox1" type="checkbox" value="Note Wizard View"  onchange="javascript:notewizardcheckbox();"  /><span
                                    style="color: Blue; font-size:21px; margin-left:6px;" >Note Wizard View</span>
                </div>
share|improve this question
When you say "disable table", do you mean "disable all form elements inside that table"? (Actual <table> elements don't really have a concept of disabled or enabled.) – nnnnnn 14 hours ago
@nnnnnYes disable all content in table – Somnath Kharat 14 hours ago

2 Answers

up vote 1 down vote accepted

To disable all form controls in the table you can do this:

$('#DispalyTable :input').prop('disabled', true);

The :input selector will select input, textarea, select and button elements.

If the Telerik / .Net controls are not "normal" html form elements but they have a disabled property then you could try this:

$('#DispalyTable td').find('*').prop('disabled', true);

That is, select all of the elements within the cells of the table and set disabled to true (even though that may not make sense for some of them).

share|improve this answer
I tried but only the controls with input gets disabled but not my telerik and asp.net controls – Somnath Kharat 14 hours ago
I've updated my answer to suggest a second option. – nnnnnn 14 hours ago
Thank u for ur rply.you are saying right but how can i disable telerik,asp.net controls.Is there no way of directly disabling the whole Table at once – Somnath Kharat 14 hours ago
Are you saying my second suggestion doesn't work? <table> elements don't have a concept of "disabled", so you have to select the elements within the table and disable them on an individual basis (jQuery gives you shortcuts to select them as a group as shown in my answer, but inside the jQuery code it loops over them all applying the disabled property to them individually). – nnnnnn 13 hours ago
Thanks it worked.....i was saying for 1 st one 2nd worked it very good – Somnath Kharat 13 hours ago

This jQuery will disable all input element inside '#DispalyTable' div.

$('#DispalyTable input').each(function(){
  $(this).attr('disabled','disabled');
}
share|improve this answer
I tried but only the controls with input gets disabled but not my telerik and asp.net controls – Somnath Kharat 14 hours ago
Can you look into/share the rendered html for your telerik & asp.net controls which are causing problem? – Parse 14 hours ago
Is there no way of directly disabling the whole Table at once – Somnath Kharat 14 hours ago
thanks for ur rply it works partially so and for ur rply +1 – Somnath Kharat 13 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.