Jim B
Jim B

Reputation: 8574

Include a Textbox inside a RadioButton

How would I include a TextBox in the middle of the text of a radio button?

For example; I want to have a radio button that says "Delay my shipment by X days"

The X in the above example would be a textbox that the user could enter in a value.

Upvotes: 0

Views: 653

Answers (2)

RQDQ
RQDQ

Reputation: 15569

An easy way to do this is to just separate the radio button text into several controls:

RadioButton1 Label1 TextBox1 Label2

Where:

  • RadioButton1 has no text.
  • Label1 Text = "Delay my shipment by "
  • Label2 Text = " days"

ASP:

<asp:RadioButton GroupName="MyGroupName" runat="server" />
Delay my shipment by <asp:TextBox runat="server"  /> days.

Upvotes: 3

thedev
thedev

Reputation: 2886

Why not place the textbox after the radion button: "Delay by no of days: X"

Upvotes: 1

Related Questions