RadioButtonList with TextBox

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
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top