【发布时间】:2019-10-02 03:27:33
【问题描述】:
我在 .aspx 页面上有以下单选按钮列表:
<asp:RadioButtonList ID="rbList" runat="server">
<asp:ListItem Text="I accept" Value="accept" />
<asp:ListItem Text="I decline" Value="decline" Selected="True" />
</asp:asp:RadioButtonList>
默认选择第二个收音机。有没有办法让我确定用户是否没有选择第一个选项,即当他们执行操作时仍然选择“拒绝”?
例如:
function checkRbList() {
var rbl = document.getElementById(<%= rbList.ClientID %>);
//if "decline" is still selected, alert('You chose to decline')...
}
【问题讨论】:
标签: javascript c# asp.net radiobuttonlist