var ret = window.showModalDialog ( sPath, myObject, sFeatures );
用这种方法打开的窗口,可以在字界面对ret赋值
比如:
var a = "1111111";
ret[0] = a;
var b = "2222222";
ret[1] = b;
window.returnValue = ret;
这时可以在父界面取到值
如果用window.open打开的窗口就更简单了

解决方案 »

  1.   

    showModalDialog('ttt.htm', window,'dialogWidth: 480px; dialogHeight: 360px; status: no; help: no');ttt.htm:
    var win;
    if (window.dialogArguments != null)
      win = window.dialogArguments;win.document.form1.inputName.value = "mm";
      

  2.   

    showModalDialog('ttt.htm', window,'dialogWidth: 480px; dialogHeight: 360px; status: no; help: no');ttt.htm:
    var win;
    if (window.dialogArguments != null)
      win = window.dialogArguments;win.document.form1.inputName.value = "mm";
      

  3.   

    或者
    ------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function setValue(){
    document.Form1.txt1.value= "changed" ; //the Value what you want
    }function openWin(){
    objWin = showModalDialog('ttt.htm', window,'dialogWidth: 480px; dialogHeight: 360px; status: no; help: no');
    }
    //-->
    </SCRIPT>
    </HEAD><BODY>
    <FORM name="Form1" METHOD=POST ACTION="">
    <INPUT TYPE="text" NAME="txt1" value="default">
    <INPUT TYPE="button" NAME="abc" onclick="openWin()" value="openWin">
    </FORM>
    </BODY>
    </HTML>-------ttt.htm-----------------
    <input type='button' value='SetValue' onclick='if (window.dialogArguments != null)window.dialogArguments.setValue();window.opener=null;window.close();'>这样做到有改动只需要修改主页面的函数。
      

  4.   

    在父窗口中用
    var ret = window.showModalDialog ( sPath, myObject, sFeatures );
    在子窗口关闭前:
    window.valueReturn="sssss"
      

  5.   

    在子窗口中用
    var dlg = dialogArguments;这里 dlg 就是父窗口的句柄, 你就可以李咏 dlg 来操作父窗口的对象了.