http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=5253

解决方案 »

  1.   

    opener.formname.textfield.value='你选择得到的值';
      

  2.   

    try:
    <body onclick="window.open('2.htm')">
    <form name=frm1>
    <input name=txt1>
    </form>
    <form name=frm2>
    <input name=txt2>
    </form>
    </body>
    2.htm
    ---------
    <select name=s multiple size=4>
    <option value=1>1
    <option value=2>2
    <option value=3>3
    <option value=4>4
    </select><input type=submit onclick="go()">
    <script>
    function go(){
    if(opener){
    var str=""
    with(document.all.s){
    for(i=0;i<options.length;i++)
    if(options[i].selected)str+=options[i].text+',';//or value
    }
    opener.document.frm1.txt1.value=str
    opener.document.frm2.txt2.value=str
    }
    }
    </script>
      

  3.   

    page1.htmarrayVal=window.showModalDialog("page2.htm","","dialogWidth=200px;dialogHeight=100px;status=0");
    处理arrayVal数组page2.htm
       ......
       将有关数据防到数组中,aData
       window.returnValue=aData;
       window.close();