View Full Version : showModalDialog
satya_tech
12-30-2003, 10:24 AM
Hi,
I am using showModalDialog to open a pop up window. When I submit some request to the server from that window. In return when the respose comes, a new IE is getting opened instaed of replacing the existing window screen.
Could you suggest pl...
Satya
bassrek
12-30-2003, 11:14 AM
Try adding a target="_self" into your <form> tag.
Jon Hanlon
12-31-2003, 08:14 PM
The modal dialog box is only a property (object) of your main window, so when you submit a form from it, the server cannot resolve the return path and creates a new window.
You should pass the window (self) object to the modal dialog, then have the dialog box submit a form in the main window.
In the main window
<form name="f1" action="...">
<input type="hidden" name="x1">
<input type="hidden" name="x2">
</form>
<script>
window.showModalDialog("www.somepage.html",self,"dialogHeight:100px; centered: yes")
In the modal box
var mom = window.dialogArguments;
mom.forms.f1.x1.value = "whatever"
mom.forms.f1.x2.value = "yeah yeah"
mon.forms.f1.submit();
setTimeout("self.close()",500)
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodaldialog.asp
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.