Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting html textbox value from radiobuttonlist 2

Status
Not open for further replies.

ozane

Technical User
Feb 3, 2005
57
TR
hi,
i have a radiobuttonlist control and in it i have textboxes. how can i get the entered value of textbox in code. here is my radiobutton code.

<asp:RadioButtonList id="Time" runat="server" Width="568px">
<asp:ListItem Value="1" Selected="True">Anytime</asp:ListItem>
<asp:ListItem Value="2">Time Period - From : <input type="text" id="timeFrom" /> to : <input type="text" id="timeTo" /></asp:ListItem>
<asp:ListItem Value="3">Date Posted - After : <input type="text" id="timeAfter" /></asp:ListItem>
</asp:RadioButtonList></P>

Thanks..
 
I quick way is:
Add a name attribute
<input type="text" id="timeFrom" name="timeFrom" />
On post back use: Request.Form("timeFrom") to retrieve the value.
It is not the best server side programing but it works. I no you can't add server controls to a listitem so the above method is the only way.
 
so is there a better way to add a textbox in radiobutton list.
i want to see the textbox with radio button, this view is what i want to see.
 
I can't add server controls to a radion button list.
What you have done above is add literal text content that is only interpreted by the browser and not the server.
 
Try just creating a table or use CSS and use all server controls. And line them up as you need. This way, you can acces ALL of the conrols from your code behind.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top