ASP.net hiding panel using javascript

Posted by Zaps on Stack Overflow See other posts from Stack Overflow or by Zaps
Published on 2010-03-12T15:08:23Z Indexed on 2010/03/12 15:17 UTC
Read the original article Hit count: 164

Hi,

I have a radioButtonList with 2 items in it. A radiobutton with a "Yes" value and a radionButton with a "No" value.

Below that I have a panel which I want made visible when "Yes" radioButton is selected and hidden when "No" is selected. I had originally implemented this using the AutoPostBack attribute but I want to do it in Javascript so that it doesn't cause a postback. Here's the code. Any help would be greatly appreciated.

<asp:RadioButtonList ID="rbl1" runat="server" onClick="changed(this);" >
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No">No</asp:ListItem>

<asp:Panel ID="panel1" runat="server">
<--other controls here -->
</asp:Panel>

function changed(rbl) {
        //not sure what to put in here
    }

Thanks in advance,

Zaps

© Stack Overflow or respective owner

Related posts about radiobuttonlist

Related posts about panel