RadioButtonList with TextBox

  • Thread starter Thread starter Philip Wagenaar
  • Start date Start date
P

Philip Wagenaar

As far as I can tell it is not possible to make a
RadioButtonList with a textbox as an Item.

Ie.

1. Yes
2. No
3. Other [ ]

[ ] would be the textarea.

When I put the textarea in the list:
<asp:ListItem Value="6. Other">6. Other
<asp:TextBox id="Textbox7"
runat="server"></asp:TextBox></asp:ListItem>

The control cannot be created
 
Philip,

I solved this not by including the text box in the list, but by placing it
at the end. Then I used a required field validator to make certain that at
least one of the radio button list's items had to be selected. In the code
behind of the page I check the list on post-back to see if "other" was
selected. If it was I make certain that the text box is filled in. If not
then move on. (I haven't bothered to write a client side validator, but am
planning to some day.)

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top