楼主这100分就不好赚呐。
具体的大段代码贴起来不方便,楼主看起来只怕也会晕。给个思路吧。
在sub.htm中,取得哪个些多选框被选中,然后再得到被选中的多选框在table的哪一行,得到行号,根据行号把相应的单元格中的innerText取出,在parent.htm中在相应的table中inertRow()插入一行,然后把事先取出的innerText填进去。

解决方案 »

  1.   

    to andrewy():
    注册的时候加上去的,修改注册资料也可以修改,但现在我没找到在哪里修改资料。
      

  2.   

    <body id="www.never-online.net">
    <script type="text/javascript">
    //<![CDATA[
        function FnCompare(sPageUrl) {
          var a = document.getElementsByName("cb");
          var v = ''; for (var i=0; i<a.length; i++) {
            a[i].checked?v += a[i].value+(i==a.length-1?'':','):'';
          }
          sPageUrl = sPageUrl+'?q='+v;
          window.alert(sPageUrl);
          window.open(sPageUrl,'','');
        }
    //]]>
    </script>
    <button onclick="FnCompare('compare.aspx')">compare</button>
    <table border="1" cellpadding="0" cellspacing="0" width="100%" >
      <tr>
        <td><input type="checkbox" name="cb" value="1"/></td>
        <td>information</td>
      </tr>
      <tr>
        <td><input type="checkbox" name="cb" value="2"/></td>
        <td>information</td>
      </tr>
      <tr>
        <td><input type="checkbox" name="cb" value="3"/></td>
        <td>information</td>
      </tr>
      <tr>
        <td><input type="checkbox" name="cb" value="4"/></td>
        <td>information</td>
      </tr>
    </table>
      </body>
      

  3.   

    子窗口用Request获取传递过来的集合到数据库里查询即可
      

  4.   

    to xuStanly(黑金):
    你的建议和我的想法差不多,这样确实很麻烦,我再想有没有读写一整行的方法。
      

  5.   

    parent.html:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    </head><body>
    <input type="button" value="选择" onclick="window.open('sub.html','','width=400,height=300,status=1')">
    <table id="tp" border="1"></table>
    </body>
    </html>
    sub.html:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <script>
    function sel(){
    var obj = document.getElementsByTagName("input");
    var id; //行号
    var pid;//父窗口新增行的行号
    var cell;//父窗口新增的单元格
    for(i=0;i<obj.length;i++){
    if(obj[i].checked){
    id = obj[i].parentNode.parentNode.rowIndex;
    pid = opener.tp.insertRow();
    for(n=0;n<3;n++){
    cell = pid.insertCell();
    cell.innerText = ts.rows[id].cells[n].innerText;
    }
    }
    }
    }
    </script>
    </head><body>
    <table id="ts" border="1">
    <tr><td>123</td><td>123</td><td>123</td><td><input type="checkbox"></td></tr>
    <tr><td>456</td><td>456</td><td>456</td><td><input type="checkbox"></td></tr>
    <tr><td>789</td><td>789</td><td>789</td><td><input type="checkbox"></td></tr>
    <tr><td colspan="4"><input type="button" value="选择" onclick="sel()"></td></tr>
    </table>
    </body>
    </html>
      

  6.   

    to BlueDestiny(blog.never-online.net):
    非常感谢你提供代码,不过你的代码和我希望的有些出入,你的实现方式是通过服务器交互的。我希望完全在客户端通过javascript实现。
      

  7.   

    to xuStanly(黑金):
    感谢!请到下面两贴接分!(你赚我这两百分可并不难哦~  :-) )
    http://community.csdn.net/Expert/TopicView3.asp?id=5014061
    http://community.csdn.net/Expert/TopicView3.asp?id=5014064
      

  8.   

    1、window.open('子文件名.html','名')可以打开子窗体
      

  9.   

    2、opener.document.父窗体from.父窗体控件.value=document.form2.子窗体控件.value;
    将子窗体中的值传给父窗体。
      

  10.   

    noname1.html
    ---------------------
    <body id="www.never-online.net">
    <script type="text/javascript">
    //<![CDATA[
    function FnOpenWindow(sPageUrl) {
    var w = window.open(sPageUrl);
    }
    //]]>
    </script>
    <button onclick="FnOpenWindow('noname2.html')">compare</button>
    <table border="1" cellpadding="0" cellspacing="0" width="100%" id="tbl">
    </table>
    </body>
      

  11.   

    noname2.html
    -----------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title> - http://www.never-online.net </title>
        <meta http-equiv="ImageToolbar" content="no" />
        <meta name="author" content="never-online, BlueDestiny"/>
        <script type="text/javascript">
        //<![CDATA[
          var prefixName = "neverOnline";
          var openerElementId = 'tbl';
          var checkBoxName = "cb";      function FnGetRow(o) {
            while (o.tagName!="TR") {
              o = o.parentNode;
            }; return o;
          }
          function FnBar(o) {
            var oTr = FnGetRow(o);
            var $ = window.opener.document.getElementById;
            var oTbl = $(openerElementId);
            try { var e = $(prefixName+o.value); } catch(ex) {};
            if (o.checked) {
              if (e) return; else {
                var tr = oTbl.insertRow();
                tr.id = prefixName+o.value;
                for (var i=0; i<oTr.cells.length; i++) {
                  var td = tr.insertCell(i);
                  td.innerHTML = oTr.cells[i].innerHTML;
                }
              }
            } else {
              e?e.parentNode.removeChild(e):"";
            }
          }    //]]>
        </script>
      </head>
      <body id="www.never-online.net">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td><input type="checkbox" name="cb" value="1"/></td>
            <td>information</td>
          </tr>
          <tr>
            <td><input type="checkbox" name="cb" value="2"/></td>
            <td>information</td>
          </tr>
          <tr>
            <td><input type="checkbox" name="cb" value="3"/></td>
            <td>information</td>
          </tr>
          <tr>
            <td><input type="checkbox" name="cb" value="4"/></td>
            <td>information</td>
          </tr>
        </table>
        <script type="text/javascript">
        //<![CDATA[
        var FnLoadEvent = function() {
          var a = document.getElementsByName(checkBoxName);
          for (var i=0; i<a.length; i++) {
            a[i].onclick = function() { FnBar(this); }
          }
        }();
        //]]>
        </script>
      </body>
    </html>