I have a RadioButtonList
and a TextBox
. Depending on the selection made in the RadioButtonList, I need to filter the content of the textbox.
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
<asp:ListItem Text="NUMBER" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="TEXT" Value="2"></asp:ListItem>
</asp:RadioButtonList>
<asp:TextBox ID="txtID" runat="server">
When the list item with value 1
is clicked, the user should be able to enter a number in the textbox. If they select value 2
, they can enter both numbers and text. Additionally, I would like to set a maximum length for input. Can someone provide guidance on how to achieve this?