js获取C# RadioButtonList选中值

<script language="javascript" type="text/javascript">
    function aa()
        {
        var b=document.all.rdoBanklist.length;
        var a=document.getElementById("rdoBanklist").cells.length;

        for(var i=0;i<a;i++)
        {
          var ss="rdoBanklist_"+i;
          var aa=document.getElementById(ss).value;
          //if(eval('document.all.rbtid_'+i).checked==true) //这样也行 eval()函数能将数据符串转成js运行
          var bb=document.getElementById(ss);
          if(document.getElementById(ss).checked) //注意checked不能写成Checked,要不然不成功
           {
                  document.getElementById("Hidden1").value=aa;
                  break;
           }     
       
        }
        }

</script>

你可能感兴趣的:(RadioButton)