如题

解决方案 »

  1.   

    <script>
    window.opener.document.getElementById(' parentInput ').value='returnMsg';
    window.close();
    </script>"
    这样吗 ?
      

  2.   

    这是一种方法
    还有就是在子页面里面设置返回值 window.returnvalue='返回值'; 必须是模式窗口
      

  3.   

    父窗体核心代码:
    <script>
    function SelectArcListA(fname){
    var posLeft = 10;
    var posTop = 10;
    window.open("content_select_list.asp?f="+fname+"&k="+form1.keyword.value, "selArcList", "scrollbars=yes,resizable=yes,statebar=no,width=700,height=500,left="+posLeft+", top="+posTop);
    }
    </script>
    <input name="lsel" type="button" id="lsel" class="nbt" style="width:150px" onChange="" value="从已发布文档中选取..." onClick="SelectArcListA('form1.xiangguanid');"> 子窗体核心代码<SCRIPT language=javascript>
    //获得选中文件的文件名
    function getCheckboxItem()
    {
    var allSel="";
    if(document.form2.arcID.value) return document.form2.arcID.value;
    for(i=0;i<document.form2.arcID.length;i++)
    {
    if(document.form2.arcID[i].checked)
    {
    if(allSel=="")
    allSel = document.form2.arcID[i].value;
    else
    allSel = allSel+","+document.form2.arcID[i].value;
    }
    }
    return allSel;
    }
    function selAll()
    {
    for(i=0;i<document.form2.arcID.length;i++)
    {
    if(!document.form2.arcID[i].checked)
    {
    document.form2.arcID[i].checked=true;
    }
    }
    }
    function noSelAll()
    {
    for(i=0;i<document.form2.arcID.length;i++)
    {
    if(document.form2.arcID[i].checked)
    {
    document.form2.arcID[i].checked=false;
    }
    }
    }
    function ReturnValue()
    {
    if(window.opener.document.form1.xiangguanid.value==""){
    window.opener.document.form1.xiangguanid.value = getCheckboxItem();
    }
    else{
    window.opener.document.form1.xiangguanid.value += ","+getCheckboxItem();
    }
    alert("成功增加你选中的ID,你可以继续增加");
    //window.opener=true;
    //window.close();
    }
      

  4.   

    下面是html代码,页面中需要<input type="checkbox" name="arcID" value="<%=rs("id")%>">输出选择的id
    复制代码 代码如下:
    <A class=inputbutx
    href="javascript:selAll()">全选</A> <A class=inputbutx
    href="javascript:noSelAll()">取消</A> <A class=inputbutx
    href="javascript:ReturnValue()">把选定值加到列表</A>
      

  5.   

    补充一个,本质上也是利用window.opener:
    window.opener.name = 要传的值window.name可以放几十兆的数据