你在提交form的时候打开对话框

解决方案 »

  1.   

    设置form的target属性看看<form method="post" target="_parent"
      

  2.   

    回复:showbo 
    设置了 target="_parent",还是会弹出来一个新的窗口回复:chinmo 
    情况就是这样的,是不是没有描述清楚。
    简单的说就是:showModalDialog打开的页面内嵌了个iframe,如何在iframe内能刷新iframe的父窗口
    谢谢各位!
      

  3.   

    用top.window()应该可以得到父窗口这个对象。
    top.window().frames[0]可以得到你当前的iframe对象。
      

  4.   

    window.parent操作父窗口应该就可以
      

  5.   

    在B页面调用A页面的函数方法,不能提交到A页面吗?
      

  6.   


    我说得还不够清楚吗??
    你这里有2次父级,首先是iframe的父级,然后就是showModalDialog打开的页面的父级
      

  7.   

    想在iframe内能刷新iframe的父窗口,那么必须在iframe里写一个JS函数是上2次父级的
      

  8.   

    好像提交不到showModalDialog打开的窗口。不过你要更新父窗口的内容,可以这样test.htm
    <input type="button" onclick="showModalDialog('a.htm')" value="ShowModalDialog"/>a.htm
    <iframe src="b.htm"></iframe>
    <br/><div id="divTime"></div>b.htm
    <script>
    function OpParent(){
      var d=new Date();
      parent.document.getElementById("divTime").innerHTML="当前时间为--"+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
    }</script>
    <form method="get" action="b.htm" target="_parent">
    <input type="submit" value="提交" name="submit" onclick="OpParent();return false;"/>
    </form>