RadioButtonList js获取选择的项

<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>

上一篇:Oracle恢复删除数据 && connect by 树形结构查询


下一篇:使用adb shell启动特定activity