Search code examples
c#radiobuttonlist

RadioButtonLIst with option for "Other"


Any suggestions on how I would create a radio button list with an option for the user to input free text?

Here's a quick sample of what i'd be looking for:

  • Red
  • Blue
  • Green
  • Other (textbox would go here)

Solution

  • Have a look at

    Something like this

    <asp:RadioButtonList ID="rdo" Runat="server">
        <asp:ListItem>First</asp:ListItem>
        <asp:ListItem>Second</asp:ListItem>
        <asp:ListItem>Others <input type="text" name="txtOthers"></asp:ListItem>
    </asp:RadioButtonList>