<input type="checkbox" name="show" id="show" />显示
<input type="checkbox" name="show2" id="show2" />显示2
<table name="table1">
   
</table><table table="table2"> 
   
</table>问题描述:
选中”显示“的时候,显示table1表单或者table1表单可编辑,没有选中的时候,默认是没显示表单或者不可编辑状态
怎么实现 ~~谢谢了。

解决方案 »

  1.   

    这个很容易实现的:不可编辑状态,你用的如果是disabled的话,当你选中显示的时候,就获取table中所以的表单元素,然后遍历,去掉他们的disabled属性即可
      

  2.   

    考虑一下jquery
    var n = $("#listinfo_tbl :checkbox:enabled[name$='].selectFlag']:not(:checked)").length;
      

  3.   


    function show(id){
    document.getElementById(id).style.display = document.getElementById(id).style.display == "none" ? "" : "none";
    }
    </script><input type="checkbox" name="show" id="show" onclick="show('table1')"  />显示
    <input type="checkbox" name="show2" id="show2" onclick="show('table2')"  />显示2
    <table id="table1">
       
    </table><table id="table2"> 
       
    </table>
    table好像没有“name”属性吧?改用“id”。