IT

页面代码:

<asp:RadioButtonList ID="RadioButtonList1" onclick="hao()" runat="server"
                        RepeatDirection="Horizontal">
                </asp:RadioButtonList>

js部分:

<script type="text/javascript">

function hao()
        {
            var aa=document.getElementsByName("RadioButtonList1");
            var cc="";
            for(var   i=1;i <aa.length;i++)
            {
                if(aa[i].checked)
                { 
                    cc=aa[i].value;
                }
            }
            if(cc=="21")
            {
                document.getElementById("hwmc").style.display="";
                document.getElementById("hwsl").style.display="";
            }
            if(cc=="22")
            {
                document.getElementById("hwmc").style.display="none";
                document.getElementById("hwsl").style.display="none";
            }
        }

</script>

posted on 2010-12-01 18:38  liufei  阅读(524)  评论(0编辑  收藏  举报