RT  就是页面有很多radiobuttonlist,能判断是否有项被选中,选中的radiobuttonlist变色就可以了
谢谢

解决方案 »

  1.   

    js:function chkallclick() {
        for (i = 0; i < document.getElementsByName("xxx").length; i++) {
            ......
        }
    }
      

  2.   

    页面有radiobuttonlist,id为RadioButtonList1
    html:
            <asp:RadioButtonList ID="RadioButtonList1" runat="server"  onclick="test()">
              .................
            </asp:RadioButtonList>
    js:
            function test() {
                var a = document.getElementById("RadioButtonList1").rows.length;
                for (var i = 0; i < a; i++) {
                    var ss = "RadioButtonList1_" + i;
                    var aa = document.getElementById(ss).value;
                    if (document.getElementById(ss).checked)
                        document.getElementById(ss).style.backgroundColor = "#ff0000";
                    else
                        document.getElementById(ss).style.backgroundColor = "#ffffff";
                }
            }
      

  3.   

      var frm = window.Form1;   
      for (i = 0; i < frm.length; i++) {
                        e = frm.elements[i];
                        if (e.type == 'checkbox' && e.checked) {
    ...................
    }
      

  4.   

    好像错了!
    if (e.type == 'checkbox' && e.checked)
    ——————》
    if(e.type=='radio'&&e.checked)