2009-12-15 64 views
0

有关如何创建单选按钮列表的任何建议,以及用户输入自由文本的选项?RadioButtonLIst选项为“其他”

这里有一个快速的样本什么我会寻找:

  • 绿色
  • 其他(文本框会去这里)

回答

0

看一看

像这样的事情

<asp:RadioButtonList ID="rdo" Runat="server"> 
    <asp:ListItem>First</asp:ListItem> 
    <asp:ListItem>Second</asp:ListItem> 
    <asp:ListItem>Others <input type="text" name="txtOthers"></asp:ListItem> 
</asp:RadioButtonList> 
+4

说完只是看着这一点,ABO使用服务器端标记时,标记不起作用。你会得到一个Parser错误:“'asp:ListItem'的'Text'属性不允许子对象。” – PabloC 2010-03-29 13:44:06

1

你可以只要有一个单选按钮列表,然后在事件设置中选择了其他时,文本框启用,否则禁用它,如果它不是其他按钮。