cancel
Showing results for 
Search instead for 
Did you mean: 

How can I apply the same ID to Radiobuttons and text boxes on one form?

I am wondering how can I apply the same ID to a list of radio buttons and a text box in the same form. 

 

I want to have the option of radiobuttons with differnet $ amounts, and have one of those be "other amount" and in the other amount option there will be a text box, where the user can type in any amount.  

 

At the moment I can do it for one or the other, apply one "ID" value to the radio buttons and one to the the textbox but not to both.

 

So how can I go about having the same ID applied to radio buttons and a textbox on one form?

 

I am using the Advanced Integration Method (AIM), the code is written in .aspx.cs (cshrap).

 

Here is a sample of what I currently have:

 

<asp:RadioButtonList ID="amount" runat="server" TextAlign="Left" RepeatDirection="Horizontal">
<asp:ListItem Value="Option1">Option1</asp:ListItem>
<asp:ListItem Value="Option2">Option2</asp:ListItem>
<asp:ListItem Value="Option3">Option3</asp:ListItem>
<asp:ListItem Value="Other">Other Amount: </asp:ListItem>
</asp:RadioButtonList>

<asp:TextBox ID="amount" runat="server"></asp:TextBox>

- Jesus

JesusJ
Member
1 REPLY 1

You can't.

If you are using AIM, it doesn't matter what you ID it on the screen. Just check it on the code-behind to see which one to use.

 

RaynorC1emen7
Expert