<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Value="0" Selected="True" Text="方向一" ></asp:ListItem>
<asp:ListItem Value="1" Text="方向二"></asp:ListItem>
<asp:ListItem Value="2" Text="方向三"></asp:ListItem>
<asp:ListItem Value="3" Text="方向四"></asp:ListItem>
</asp:RadioButtonList>
<script type="text/javascript">
function CheckIsSelected() {
var rbl = document.getElementById("<%=RadioButtonListCosmetic.ClientID%>");
var radio = rbl.getElementsByTagName("input");
var isSelect = false;
for (var i = 0; i < radio.length; i++) {
if (radio[i].checked) {
isSelect = true;
break;
}
}
if (!isSelect) {
alert("请选择一个选项。");
}
return isSelect;
}
</script>