javascript window problem
Hi
I'm using javascript window.open to open an .asp page to get some user input.
This window is opened above my current webpage, but is there any way to make
this new window modal so that the user can't access the page underneath it
???
If there isn't a way to do this, is there any way to know when the new window
is loosing focus (like a onLostFocus event or something similar). I thought
I could use an approach like this to close the window if the focus is lost
Help appeciated
** Please response to the group ***
/John
Re: javascript window problem
"john" <john70@hotmail.com> wrote:
>
>Hi
>
>I'm using javascript window.open to open an .asp page to get some user input.
>This window is opened above my current webpage, but is there any way to
make
>this new window modal so that the user can't access the page underneath
it
>???
>
>If there isn't a way to do this, is there any way to know when the new window
>is loosing focus (like a onLostFocus event or something similar). I thought
>I could use an approach like this to close the window if the focus is lost
>
>Help appeciated
>** Please response to the group ***
>
>/John
John:
There is no onLostFocus event handler for the window object, but you can
use the onFocus event handler of the parent window to close that window.
Re: javascript window problem
John,
I tried it by putting a call to window.close(); in the onblur event of the
body tag on the "modal" window and it worked in IE 5.5. The window closed
when I clicked away from that browser window.
I have seen modal windows, but cannot remember how they were done. I know
that it is not as simple as "newWindow = window.open("blah.htm", modal);"
The one time that I saw it done, the guy had some trick he used...sorry,
I can't remember. (it may have even been done with client-side VBScript).
Good Luck
"john" <john70@hotmail.com> wrote:
>
>Hi
>
>I'm using javascript window.open to open an .asp page to get some user input.
>This window is opened above my current webpage, but is there any way to
make
>this new window modal so that the user can't access the page underneath
it
>???
>
>If there isn't a way to do this, is there any way to know when the new window
>is loosing focus (like a onLostFocus event or something similar). I thought
>I could use an approach like this to close the window if the focus is lost
>
>Help appeciated
>** Please response to the group ***
>
>/John
Re: javascript window problem
If you're using IE, look at the showModalDialog (IE4 and higher) method. The
command creates a modal dialog (defined in a separate file)and displays it
above the opening HTML document. For Netscape browsers, Webreference.com
states:
"You can achieve [a] similar effect in Navigator by specifying the onBlur
event handler:
<BODY onBlur="window.focus()">
If you use the above event handler in the <BODY> tag, the window holding the
document remains focused until the user closes it. There are several
differences between this Navigator-only technique and Internet Explorer's
showModalDialog() method. First of all, the focused window isn't associated
with a specific window (or document). That is, the user cannot bring up any
other browser window, even if it isn't the window that opened the dialog
window. In addition, the user can still bring up a different window for a
moment, which is enough to close the opener window while the "modal" dialog
is open."
"john" <john70@hotmail.com> wrote in message
news:3b5b18aa$1@news.devx.com...
>
> Hi
>
> I'm using javascript window.open to open an .asp page to get some user
input.
> This window is opened above my current webpage, but is there any way to
make
> this new window modal so that the user can't access the page underneath it
> ???
>
> If there isn't a way to do this, is there any way to know when the new
window
> is loosing focus (like a onLostFocus event or something similar). I
thought
> I could use an approach like this to close the window if the focus is lost
>
> Help appeciated
> ** Please response to the group ***
>
> /John
Re: javascript window problem
hi,
i've been researching this same problem this week. Since u asked for a modal
window, the following link is the most comprehensive that I have found -
cross browser/platform modal window:
http://developer.netscape.com:80/vie...man_modal.html
regards
benG