<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<input type=text id=tt>
<script language="javascript">
<!--
document.all.tt.value = window.showModalDialog("pass.htm");
//-->
</script>
</body></html>
pass.htm<html>
<script language="JavaScript">
function check(){
 window.returnValue="kkkkkkkk";
 window.close();
}
</script>
<body>
<form name="aForm" method="post" action="">
<table width="200" hight="100" border="0" align="center">
  <tr>  
    <TD>
      <input type="button" name="button" onClick="check();" value="确定">
    </TD>   
  </TR>
</TABLE>
</form>
</body>
</html>

解决方案 »

  1.   

    document.aForm.text.value = window.showModalDialog("pass.html");
    这句有问题吧你可以将返回值alert出来试试
      

  2.   

    <html>
    <script language="JavaScript">
    function check(){
     window.returnValue="kkkkkkkk";
     window.close();
    }
    </script>
    <body onunload="check()">
    <form name="aForm" method="post" action="">
    <table width="200" hight="100" border="0" align="center">
      <tr>  
        <TD>
          <input type="button" name="button" onClick="check();" value="确定">
        </TD>   
      </TR>
    </TABLE>
    </form>
    </body>
    </html>
      

  3.   

    很简单,因为你直接点关闭按钮关闭窗口了,而这个时候你的model dialog中没有任何返回值。
    解决的方法也很简单,只要在model dialog的页面的onload事件中对returnValue进行赋值就可以了
      

  4.   


    document.aForm.text.value = window.showModalDialog("pass.html");
    这句有问题
      

  5.   

    楼上错
    document.aForm.text.value = window.showModalDialog("pass.html");
    这句没问题
      

  6.   

    我是楼主,诸位大师的方法都试过了,还是undefined! 现在一看见tmd这个词都开始发抖了~~
      

  7.   

    pass.html:
    <head>
    <script language="JavaScript">
    window.returnValue=-1;
    </script>
    </head>
      

  8.   

    可以在onunload 中判断,也可以直接在返回值中判断
    var rv=window.showModalDialog("pass.html",null,"");
    if(!rv)
    {}