By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

I want a popup window onclick which close itself when next page is displayed

P: n/a
KS
Is it possible to write a javascript that makes a popup window when someone
click on buttons/href on my page and close itself when the new page is about
to get loaded? I want to prevent the user from clicking anything else on my
page while the request is getting a new page. The popup window must lock the
focus.
I use frames i can not just disable all the buttons an href in different
frames.
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello

you can get the window object as var newwin = window.open() ; later as the
page unloads you can call newwin.close();
to catch the document unload event capture the window.unload event.

--
Elias
http://lgwm.org/
"KS" <ka*****@hotmail.com> wrote in message
news:3f********@news.broadpark.no...
Is it possible to write a javascript that makes a popup window when someone click on buttons/href on my page and close itself when the new page is about to get loaded? I want to prevent the user from clicking anything else on my page while the request is getting a new page. The popup window must lock the focus.
I use frames i can not just disable all the buttons an href in different
frames.

Jul 20 '05 #2

P: n/a
KS
Thanx thats what i was looking for and i did something like this.

<//html file A
<SCRIPT>

// Vedlikehold av regningsadresse
function ventvindu() {
open("/PlexSysWeb/marked/venting.jsp", "jada123", "width=x,height=y");
}

</SCRIPT>
//html file B that close what A as opened
<SCRIPT>

var w = open("#", "jada123");
w.close();
</SCRIPT>

There is only one problem to this. Nothing prevents the user from clicking
on the html page A and ignore the popup window to hold youre horses until
the prosess is done. I NEED to prevent any clicking whatsoever while
somepage is prosessing. Making it bulletproof even for the most stupid user
!
"lallous" <la*****@lgwm.org> skrev i melding
news:bj************@ID-161723.news.uni-berlin.de...
Hello

you can get the window object as var newwin = window.open() ; later as the
page unloads you can call newwin.close();
to catch the document unload event capture the window.unload event.

--
Elias
http://lgwm.org/
"KS" <ka*****@hotmail.com> wrote in message
news:3f********@news.broadpark.no...
Is it possible to write a javascript that makes a popup window when

someone
click on buttons/href on my page and close itself when the new page is

about
to get loaded? I want to prevent the user from clicking anything else on

my
page while the request is getting a new page. The popup window must lock

the
focus.
I use frames i can not just disable all the buttons an href in different
frames.


Jul 20 '05 #3

P: n/a
Hi

One suggestion is to make the popup window big enough to cover its parent.
I am not sure if Onblur event will work with window object, if so, you can
capture OnBlur and then setfocus() again.

--
Elias
http://lgwm.org/
"KS" <ka*****@hotmail.com> wrote in message
news:3f********@news.broadpark.no...
Thanx thats what i was looking for and i did something like this.

<//html file A
<SCRIPT>

// Vedlikehold av regningsadresse
function ventvindu() {
open("/PlexSysWeb/marked/venting.jsp", "jada123", "width=x,height=y");
}

</SCRIPT>
//html file B that close what A as opened
<SCRIPT>

var w = open("#", "jada123");
w.close();
</SCRIPT>

There is only one problem to this. Nothing prevents the user from clicking
on the html page A and ignore the popup window to hold youre horses until
the prosess is done. I NEED to prevent any clicking whatsoever while
somepage is prosessing. Making it bulletproof even for the most stupid user !
"lallous" <la*****@lgwm.org> skrev i melding
news:bj************@ID-161723.news.uni-berlin.de...
Hello

you can get the window object as var newwin = window.open() ; later as the page unloads you can call newwin.close();
to catch the document unload event capture the window.unload event.

--
Elias
http://lgwm.org/
"KS" <ka*****@hotmail.com> wrote in message
news:3f********@news.broadpark.no...
Is it possible to write a javascript that makes a popup window when

someone
click on buttons/href on my page and close itself when the new page is

about
to get loaded? I want to prevent the user from clicking anything else on
my
page while the request is getting a new page. The popup window must
lock the
focus.
I use frames i can not just disable all the buttons an href in

different frames.



Jul 20 '05 #4

P: n/a
KS
The onblure was not a bad idee ill try it.
Have the popup cover the hole page seems a bit extreme since this is a
serious web application.
I tried jusing showModalDialog window for IE and works the way that i want.
It locks all the foucus into the window, the only problem it also stops all
the posting from the parent page until showM.. window is closed. The idea is
that the next page should close it not the user.
If i somehow could use showModalDialog, but make the parent page got to next
page, and make that next page close showModalDialog. This actually works
with window.open but then the focus will not be locked the way i want.

Another solution is to capture all click event from the usermouse and
somehow supress it after someone have clicked a button on the page. Not sure
how to this.

Since the web application a combination of frames and include i need a
general way to prevent user actions after a button are clicked. Disable all
buttons on a singel page which not use of frames is solved by using
document.getElementsByTagName
and loop trhough the hole document and disable whatever i want.

Thanx for the idea
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.