因为传过来的是window对象,所以也可以通过它传值给父窗口
var win = window.dialogArguments;
win.document.getElementById("txt1").value = document.getElementById("result").value
这样就不用returnValue了可能是递交引起window句柄的丢失
如果可能, 可以考虑在子窗口用frameset,将window句柄保存在隐藏的frame中,递交前后都可以从中取得win进行传值

解决方案 »

  1.   

    father.php
    ==========================================
    <SCRIPT> 
    function opslogin(str1,str2,str3) 

    showModelessDialog(str1,window,'dialogHeight:'+str2+'px;dialogWidth:'+str3+'px;scroll:no;resizable:no;status:no;help:no'); 
    } function fnUpdate(s)
    {
    document.getElementById("myname").value = s;
    }
    </SCRIPT> 
    <input id="myname">
    <input type="submit" name="Submit" value="cd1" onclick="opslogin('js.html','200','300');"/> 
    <?php 
    print_r($_POST); 
    ?> 
    child.php
    --------------------------------------------<script>
    function fchange()
    {
      var sData = dialogArguments;
      alert(sData.fnUpdate)
      sData.fnUpdate(document.getElementById("mytest").value);
    }
    </script>
    <base target="_self"> 
    <form action="farther.php" method="post"> 
    <input name="mytest" id="mytest" type="text" onchange="fchange()"> <input name="提交" type="submit" value="提交"> 
    </form>