在网上随便找的一点资料,主要通过window.dialogArguments或window.returnValue 
传入参数:
  要想对话框传递参数,是通过vArguments来进行传递的。类型不限制,对于字符串类型,最大为4096个字符。也可以传递对象,例如:  test1.htm
  ====================
  <script>
    var   mxh1   =   new   Array("mxh","net_lover","孟子E章")
    var   mxh2   =   window.open("about:blank","window_mxh")
    //   向对话框传递数组
    window.showModalDialog("test2.htm",mxh1)
    //   向对话框传递window对象
    window.showModalDialog("test3.htm",mxh2)
  </script>  test2.htm
  ====================
  <script>
    var   a   =   window.dialogArguments
    alert("您传递的参数为:"   +   a)
  </script>  test3.htm
  ====================
  <script>
    var   a   =   window.dialogArguments
    alert("您传递的参数为window对象,名称:"   +   a.name)
  </script>  可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:  test4.htm
  ===================
  <script>
    var   a   =   window.showModalDialog("test5.htm")
    for(i=0;i<a.length;i++)   alert(a[i])
  </script>  test5.htm
  ===================
  <script>
  function   sendTo()
  {
    var   a=new   Array("a","b")
    window.returnValue   =   a
    window.close()
  }
  </script>
  <body>
  <form>
    <input   value="返回"   type=button   onclick="sendTo()">
  </form>

解决方案 »

  1.   

    我自己写一个例子吧:
    test1.htm:
    <script>
        var result;//保存结果
        window.show.showModalDialog("test2.htm",result)
    </script>test2.htm:
      <script>
        window.dialogArguments = mytextbox.value;//其中 mytextbox 为你的文本框的名字
      </script>
      

  2.   

    可能是我没有表达清楚,是这样的test1.htmfunction test()
    {}<input type="text" name="text1">
    <input type="text" name="text2">
    <input type="text" name="text3">
    <input type="text" name="text4">
    test2.htm<input type="hidden" name="a1" value="缅">
    <input type="hidden" name="a2" value="甸">
    <input type="hidden" name="a3" value="球">
    <input type="hidden" name="a4" value="蟒">
    <input type="button" name="提交" onclick="window.dialogArguments.test()">在showModalDialog窗口页面test2.htm中有四个值,单击"提交"按钮执行 test1.htm中的test(),使test1中的input得到test2中的值。如果在 test2.htm 中直接写下面的代码,可以让test1 取到 showModalDialog 的值,例如window.dialogArguments.document.all.text4.value = document.all.a4.value ;
    但由于test1.htm 中的输入框中的名称不能确定,输入框的数量也不能确定,(根据不同需求可能只往test1传入一个或两个或三个参数)为了方便调用,所以想在test1 中做控制。请高手指教