此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【yyyhhh0123】截止到2008-07-04 10:31:30的历史汇总数据(不包括此帖):
发帖的总数量:4                        发帖的总分数:180                      
结贴的总数量:4                        结贴的总分数:180                      
无满意结贴数:0                        无满意结贴分:0                        
未结的帖子数:0                        未结的总分数:0                        
结贴的百分比:100.00%               结分的百分比:100.00%                  
无满意结贴率:0.00  %               无满意结分率:0.00  %                  
敬礼!

解决方案 »

  1.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    <BODY>
        <input type="radio" id="1" value="" onclick="show('a')" name=r1><label>1</label>
        <input type="radio" id="2" value="" onclick="show('b')" name=r1><label>2</label>
        <input type="radio" id="3" value="" onclick="show('c','d')" name=r1><label>3</label><br>
        
        <label id="a" style="display:none"><input type="radio"  value="">a</label>
        <label id="b" style="display:none"><input type="radio" value="">b</label>
        <label id="c" style="display:none"><input type="radio" value="">c</label>
        <label id="d" style="display:none"><input type="radio" value="">d</label>
     </BODY>
     
     <script>
      var rad = ["a","b","c","d"];
      function show(){
      for(var i=0;i<rad.length;i++){
      document.getElementById(rad[i]).style.display="none";
      }
      var a = arguments;
      for(var i=0;i<a.length;i++){
      document.getElementById(a[i]).style.display="";  }
      }
     </script>
    </body></html>
      

  2.   

          您这个 可以出来下一级 radio ,但是下一级的 radio 不可以选中啊~~ 请您在看下
      

  3.   

    楼上基本正解。但不能保证页面加载时radio 1被选中radio a显示。偶小改了下。
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    <BODY>
    <input name=r1 type="radio" id="1" onclick="show('a')" value="" checked><label>1</label>
    <input type="radio" id="2" value="" onclick="show('b')" name=r1><label>2</label>
    <input type="radio" id="3" value="" onclick="show('c','d')" name=r1><label>3</label><br>
        
    <label id="a"><input type="radio"  value="">a</label>
        <label id="b" style="display:none"><input type="radio" value="">b</label>
        <label id="c" style="display:none"><input type="radio" value="">c</label>
        <label id="d" style="display:none"><input type="radio" value="">d</label>
    </BODY>
     
     <script>
         var rad = ["a","b","c","d"];
         function show(){
             for(var i=0;i<rad.length;i++){
                 document.getElementById(rad[i]).style.display="none";
             }
             var a = arguments;
             for(var i=0;i<a.length;i++){
                 document.getElementById(a[i]).style.display="";         }    
         }
     function a(){
      document.getElementById("1").checked=true;
    document.getElementById("a").style.display="";
     }
     window.onload=a;
     </script>
    </body></html>
      

  4.   

    重发一遍。解决不能选择问题。
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    <BODY>
    <input name=r1 type="radio" id="1" onclick="show('a')" value="" checked><label>1</label>
    <input type="radio" id="2" value="" onclick="show('b')" name=r1><label>2</label>
    <input type="radio" id="3" value="" onclick="show('c','d')" name=r1><label>3</label><br>
        
    <label id="a"><input type="radio"  value="" name="r2">a</label>
        <label id="b" style="display:none"><input type="radio" value="" name="r3">b</label>
        <label id="c" style="display:none"><input type="radio" value="" name="r4">c</label>
        <label id="d" style="display:none"><input type="radio" value="" name="r4">d</label>
    </BODY>
     
    <script>
         var rad = ["a","b","c","d"];
         function show(){
             for(var i=0;i<rad.length;i++){
                 document.getElementById(rad[i]).style.display="none";
             }
             var a = arguments;
             for(var i=0;i<a.length;i++){
                 document.getElementById(a[i]).style.display="";         }    
         }
     function a(){
      document.getElementById("1").checked=true;
    document.getElementById("a").style.display="";
     }
     window.onload=a;
     </script>
    </body></html>
      

  5.   

    radio要给个name才可以选择的..你写的那个也是不能选择的..
      

  6.   


          很感谢 sagadan ,还有scler  。  页面效果完全实现。。  有个问题是 后台 要取 radio的 值 怎么取?  
      

  7.   

    在表单接收页面str=request.form("r1")接收radio值
    红色部分为你radio的name。
      

  8.   

    <input name=r1 type="radio" id="1" onclick="show(1)" value="" checked> <label>1 </label> 
    <input type="radio" id="2" value="" onclick="show(2)" name=r1> <label>2 </label> 
    <input type="radio" id="3" value="" onclick="show(3)" name=r1> <label>3 </label> <br> 
        
    <label id="a" style="display:none"> <input type="radio"  value="">a </label> 
        <label id="b" style="display:none"> <input type="radio" value="">b </label> 
        <label id="c" style="display:none"> <input type="radio" value="">c </label> 
        <label id="d" style="display:none"> <input type="radio" value="">d </label> 
    </BODY> <script> 
        function show(value){ 
            switch(value)
       {
       case 1:
         document.getElementById("a").style.display=""; 
     document.getElementById("b").style.display="none"; 
     document.getElementById("c").style.display="none"; 
     document.getElementById("d").style.display="none"; 
         break
       case 2:
         document.getElementById("a").style.display="none"; 
     document.getElementById("b").style.display=""; 
     document.getElementById("c").style.display="none"; 
     document.getElementById("d").style.display="none"; 
         break
       case 3:
         document.getElementById("a").style.display="none"; 
     document.getElementById("b").style.display="none"; 
     document.getElementById("c").style.display=""; 
     document.getElementById("d").style.display="";
         break
       default:
          document.getElementById("1").checked=true; 
          document.getElementById("a").style.display=""; 
       }
        } 
    function a(value,value1){ 
    document.getElementById("1").checked=true; 
    document.getElementById("a").style.display=""; 

    window.onload=show(0); 
    </script> 
      

  9.   

             额,问题是  第一级radio 的全是 r1 标识的:
    <input name=r1 type="radio" id="1" onclick="show('a')" value="" checked> <label>1 </label> 
    <input name=r1 type="radio" id="2" value="" onclick="show('b')" > <label>2 </label> 
    <input name=r1 type="radio" id="3" value="" onclick="show('c','d')" >  那么 可以正确 取到 radio的值 ? 不可以用 id 来标识 radio的么 
      

  10.   

    这个没关系。你可以先判断r1的被选中值。然后根据r1的值判断下面应该去那个radio的name。