[原创]如何得到RadioButtonList 中的选中值
1
<asp:RadioButtonList id="RadioButtonList1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 144px"
2
runat="server">
3
<asp:ListItem Value="a" >a</asp:ListItem>
4
<asp:ListItem Value="b" Selected="True">b</asp:ListItem>
5
<asp:ListItem Value="c">c</asp:ListItem>
6
</asp:RadioButtonList>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
1
<script language="javascript">
2
function getRadio()
3
{
4
var opts = document.all("RadioButtonList1");
5
if (opts)
6
{
7
for (var i = 0; i < opts.length; i++)
8
{
9
if (opts[i].checked)
10
{
11
alert(i);
12
break;
13
}
14
}
15
}
16
}
17
getRadio();
18
19
</script>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/None.gif)
11
![](/Images/OutliningIndicators/None.gif)
12
![](/Images/OutliningIndicators/None.gif)
13
![](/Images/OutliningIndicators/None.gif)
14
![](/Images/OutliningIndicators/None.gif)
15
![](/Images/OutliningIndicators/None.gif)
16
![](/Images/OutliningIndicators/None.gif)
17
![](/Images/OutliningIndicators/None.gif)
18
![](/Images/OutliningIndicators/None.gif)
19
![](/Images/OutliningIndicators/None.gif)