JS操作RadioButtonList

   function IsUpPic() {
            var cbIspic = document.getElementById("cbIsPic");
            var arr = new Array("txtPicName", "btnUpload");
            if (cbIspic.checked) {
                for (var i = 0; i < arr.length; i++)
                    document.getElementById(arr[i]).disabled = false;
            } else {
            for (var i = 0; i < arr.length; i++)
                document.getElementById(arr[i]).disabled = true;
            }
            document.getElementById('txtPicName').value = '';
            document.getElementById('hfUpname').value = '';

            var rbRotate = document.getElementsByName("rbRotate");
            
            if (cbIspic.checked) {
                for (var i = 0; i < rbRotate.length - 1; i++) {
                    rbRotate[i].disabled = false;
                   
                }
            } else {
            for (var i = 0; i < rbRotate.length - 1; i++) {
                 rbRotate[i].disabled = true;
                }
            }
        }

        window.onload = function() {
            var rbRotate = document.getElementsByName("rbRotate");
            for (var i = 0; i < rbRotate.length - 1; i++) {
                rbRotate[i].disabled = true;
            }
        }

 参考:

        http://www.cnblogs.com/ymyglhb/archive/2009/09/02/1558809.html
        http://topic.csdn.net/t/20060508/15/4736431.html

你可能感兴趣的:(html,.net)