shahjagat
asked on
Jquery/Javascript enable or disable textbox in a radgrid edit template
I have a column with check box named "IsActive" and a column with text box named "Comments".
I have a radgrid with a check box column.
When i uncheck the checkbox in edit mode, i want to enable the text box.
I have the following code and i get
"The name 'chkActive' does not exist in the current context."
How do i access the checkbox within a radgrid?
I have a radgrid with a check box column.
When i uncheck the checkbox in edit mode, i want to enable the text box.
I have the following code and i get
"The name 'chkActive' does not exist in the current context."
How do i access the checkbox within a radgrid?
<telerik:RadGrid ID="rgClientInfo" runat="server" AutoGenerateColumns="False">
<telerik:GridTemplateColumn UniqueName="IsActive" HeaderText ="IsActive" >
<EditItemTemplate>
<ASP:CheckBox ID="chkActive" runat="server" CssClass="checkbox" Text="IsActive" onclientclick="ActivateCommentsWhenClientInactive()" />
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Comments" HeaderText ="Comments" UniqueName="Comments">
<ItemTemplate>
<ASP:Label ID="lblMemComments" runat="server" Text='<%# Eval("Comments") %>' ToolTip="Member Comments" />
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox runat="server" ID="rtbComments" Text="" Enabled="false" ></telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
</telerik:RadGrid>
function ActivateCommentsWhenClientInactive()
{
//something like this when check box is unchecked, comments should be enabled.
if($("#<%=chkActive.ClientID %>").prop('checked', false))
{
$("#<%=txtComments.ClientID %>").removeattr("disabled");
}
}
It would be helpful if we could see the rendered HTML to see what the control looks like as HTML.
ASKER
Thanks for your reply. We moved in a different direction with the code.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
ASKER
Open in new window