Link to home
Start Free TrialLog in
Avatar of searchsanjaysharma
searchsanjaysharma

asked on

How to enable disable panel using jquery.

I have the following code,
<asp:TextBox id="txtreceivingreport" Text="" runat="server">
<asp:Pane
I want when the user enters the anything in textbox, the panel should be enabled
<asp:Panel id="p1" runat="server" Enabled="false">
<asp:RadioButton id="rbmale" runat="server" Text="Male">
<asp:RadioButton id="rbfemale" runat="server" Text="FeMale">
</asp:Panel>
Avatar of Raj Shekhar
Raj Shekhar
Flag of India image

Hi,

You can do using the OnTextChanged event on Text box. And you can handle Page partial rendering using

 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<asp:AsyncPostBackTrigger>
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't use :
<asp:Panel id="p1" runat="server" Enabled="false">
but:
<asp:Panel id="p1" runat="server" style="display:none">

Now you can use :
$("#<%= txtreceivingreport.ClientID %>").keyup(function() {
     if( $(this).val().length>0 ) $("#<%= p1.ClientID %>").show();
})

Open in new window

Avatar of searchsanjaysharma
searchsanjaysharma

ASKER

ok