Name可以一样,只是用ID来区别他们,id用来传值

解决方案 »

  1.   

    你是说除了选中SelAll,还可以选其余的三个框中的一个还是全部都选?如果你说是选其它三个的话你可以这样来做
       把其它三个CheckBox放到一个Panel中,就可以了
      

  2.   

    <input type="CheckBox" id="SelAll" name="SelAll" onclick="kkk()"></input><SCRIPT language=JavaScript>
    function kkk(){
      form1.a.checked=true;
      form1.b.checked=true;  
      form1.c.checked=true;
    }
    </SCRIPT>如果只是简单的取值,不用设置其他的参数,不用设置id.
      

  3.   

    说明一下我的问题
    1、是当选择了SelAll后把其余的复选框也选中
    2、其余的复选框的个数是不确定的,是动态加载的,因此weixn的方法可能不行
      

  4.   

    <input type="CheckBox" name="SelAll"></input>
    <input type="CheckBox" name="a" value="c"></input>
    <input type="CheckBox" name="a" value="b"></input>
    <input type="CheckBox" name="a" value="c"></input>
    function kkk(){
      if(!form1.SelAll.checked) return ;
      for(i=0;i<3;i++) form1.a[i].checked=true;
    }
      

  5.   

    <input type="CheckBox" id="SelAll" name="SelAll" onclick="kkk()"></input>
      

  6.   

    <input type="CheckBox" name="SelAll" onclick="kkk()"></input>
    <input type="CheckBox" name="a" value="c"></input>
    <input type="CheckBox" name="a" value="b"></input>
    <input type="CheckBox" name="a" value="c"></input>function kkk(){
      //保证对象在form[0]里
      var tag=document.form[0];
      if(typeof(tag.a)=="undefined")return;
      if(typeof(tag.a.length)=="undefined"){
        tag.a.checked=tag.SelAll.checked; 
      }else{
         for(i=0;i<tag.a.length;i++) {
          tag.a[i].checked=tag.SelAll.checked;
         } 
      }
    }