Hi all,

I have a asp:radiobuttonlist, that the data to create it comes from the Database,

one of the option must turn visible, a text box, i have that done in codebehind in .net, but i think its lagging to much.

the problem is how can i do thins in pure javascript.

best regards

Edited by maxpaine69

4 Years
Discussion Span
Last Post by maxpaine69

Do you have sample code (just relevant code)? Should be fairly easy to use the onclick event for this.


I dont understand your last post.

Here is a simple example although it leverages jQuery which really simplifies what you are trying to do.

If you click on one the choices, an alert message is displayed with the selected value. You can easily expand this so that if a certain item is selected (with a conditional statement), then change the display property of the textbox (.show() method with jQuery).

<asp:RadioButtonList ID="RadioButtonList1" runat="server" >
    <asp:ListItem Text="1" Value="1"></asp:ListItem>
    <asp:ListItem Text="2" Value="2"></asp:ListItem>
    <asp:ListItem Text="3" Value="3"></asp:ListItem>

$("input[type='radio']").click(function () {

    if (condition is true)

thats jquery, not pure javascript, more the radiobutton its created from a database.

Edited by maxpaine69

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.