
Code
<script type="text/javascript">
//取得RadioButtonList客户端id 如服务器端控件RadioButtonList的服务器端ID为:rblTest
var radioButtonListClientID="<%= rblTest.ClientID %>"
//根据RadioButtonList控件的客户端id取被选中的值
//oId 为控件的客户端id
//返回null时为没有选中
function GetRadioButtonListSelectValue(oId) {
var returnValue=null;
var oRadioButtonList=document.getElementById(oId);
var oRadioButtonLists=oRadioButtonList.getElementsByTagName('input');
for(var i=0;i<oRadioButtonLists.length;i++) {
if(oRadioButtonLists[i].type == "radio") {
if(oRadioButtonLists[i].checked) {
returnValue = oRadioButtonLists[i].value;
break;
}
}
}
return returnValue;
}
</script>