在showModalDialog打开的画面中提交form时,不想打开新窗口的解决方法

来源:互联网 发布:flash mac 破解版 编辑:程序博客网 时间:2024/06/03 18:37

打开一个模态窗口:
window.showModalDialog(url,window,"dialogWidth:950px; dialogHeight:450px; help: no; status: no");
 
模态窗口如果提交form,会弹出一个新窗口,即使为form指定了 target="_self" 也是不行的。

 

那么要如何解决呢?
 
其实很简单,加上以下代码:
<script type="text/javascript">
       window.name = "curWindow";
</script>
 
对应的form添加target:
<form name="myForm" id="myForm" action="" method="post"  target="curWindow">

 

转自:http://www.360doc.com/content/11/0223/17/4154133_95474400.shtml

0 0
原创粉丝点击