PDA

View Full Version : how to prevent a modal dialog from bouncing?


jasongr
11-24-2004, 02:33 PM
Hello

I have create a modal dialog using the following command:

window.showModalDialog("a.html", "", "status:no;help:no;resizable:no;scroll:no;center:no");

The dialog gets displayed somewhere on the screen.

The dialog contains a button.
When the button is pressed, the content of the modal dialog is replaced with another html page (b.html).

here is the problem:
The dialog always opens in the same top-left corner it was first launched in.
If the user moves the window around, and then clicks on the button, it will bounce back to its orinigal top-left corner when b.html is rendered.

This is very annoying.

Does anyone know how this can be solved?

Jon Hanlon
11-24-2004, 07:03 PM
How is b.html rendered? By what mechanism?

jasongr
11-25-2004, 04:49 AM
b.html is the page that is loaded when the button in a.html is click.
here is the content of a.html
[code]
<head>
<base target="_self"></base>
</head>
<body>
<form name="gotoB" action="b.html" method="post">
<input type="button" value="Go" onclick="document.gotoB.submit();">
</form>
</body>
[/code
So as you can see, b.html is rendered when the form is submitted to it. The line <base target="_self"></base> causes b.html to be rendered in the same window that a.html was in, thus replacing it in the modal window

Jon Hanlon
11-25-2004, 05:58 PM
Try
<input type="button" onclick="document.location.replace('b.html')" value="Go">