parent.document.formName.elements["inputname"].value

解决方案 »

  1.   

    子窗口
    <html><body>
    <form name="f1" id="f1">
    <input type="test" id="t1" name="t1">
    <input type="button" value="ok" onclick="reValue()"><script language=javascript> 
    function reValue(){
    parent.returnValue=f1.t1.value; 
    window.close();
    }</script>父窗口
    <html>
    <body>
    <form name="frm1" id="frm1">
    <input type="text" name="rid" id="rid" onclick="openUrl()">
    </form>
    </body>
    </html>
    <script language="javascript">
    function openUrl(){
    var returnValue=window.showModalDialog("a.htm");
    frm1.rid.value=returnValue;
    }
    </script>