用文字链接作为form的提交按钮,表单全是复选框  要求复选框有全选和全取消功能,也用文字链接做
复选框的值是从数据库中数据的多少产生的
有办法实现这个功能吗?
感激不尽!

解决方案 »

  1.   

    你在aps那边的我回了个帖~http://community.csdn.net/Expert/TopicView3.asp?id=5549513
      

  2.   

    <html>
    <head></head>
    <body >
    <script language="javascript">
    function selAll(){
    for(i=1;i<6;i++){
      document.getElementById("aa"+i).checked=true;
     }
    }
    function unSelAll(){
    for(i=1;i<6;i++){
      document.getElementById("aa"+i).checked=false;
     }
    }
    function go(){
    document.getElementById("frm1").submit();
    }
    </script>
    <form action="a.asp" id="frm1">
    <a href="#" onclick="selAll()">全选</a>&nbsp;&nbsp;<a href="#" onclick="unSelAll()">取消</a><br>
     <input type="checkbox" value="bj" id="aa1" name="aa1">北京
      <input type="checkbox" value="sh" id="aa2" name="aa2">上海
       <input type="checkbox" value="gz" id="aa3" name="aa3">广州
        <input type="checkbox" value="xa" id="aa4" name="aa4">西安
     <input type="checkbox" value="cq" id="aa5" name="aa5">重庆
     <br><a href="#" id="submit" onclick="go()">提交</a>
    </form>
    </body>
    </html>checkbox的内容从数据库读出,替换一下就对了,命名的时候加上变量i就对了
    参照上面的例子