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

closing a child window on logout

P: 92
Let's say a user logs in to the system. He opens pop-up forms and then logs out.

Is there a way to automatically close all child windows(pop-up windows) when a user clicks the logout button?

I need an answer as soon as possible. Thank you.
Sep 26 '07 #1
Share this Question
Share on Google+
5 Replies

Atli
Expert 5K+
P: 5,058
Hi. Welcome to The Scripts.

I'm pretty sure this is not possible. But if it is, it would be some kind of JavaScript.
So, I'm going to move your question over there, where the JavaScript experts should find it.
Sep 27 '07 #2

acoder
Expert Mod 15k+
P: 16,027
Let's say a user logs in to the system. He opens pop-up forms and then logs out.

Is there a way to automatically close all child windows(pop-up windows) when a user clicks the logout button?

I need an answer as soon as possible. Thank you.
Post your code.

If you kept a reference to the windows created, you can close them using the close() method.
Sep 28 '07 #3

P: 92
How do I make a reference to other windows?
Oct 3 '07 #4

dmjpro
100+
P: 2,476
How do I make a reference to other windows?
Expand|Select|Wrap|Line Numbers
  1. function open_children()
  2. {
  3.  var win1 = window.open(....);
  4.  var win2 = window.opne(....);
  5.  .
  6.  .
  7. }
  8. function log_out()
  9. {
  10.  win1.close();
  11.  win2.close();
  12.  .
  13.  .
  14. }
  15.  
Remember one thing the second parameter in window.open must be different for different windows.

Kind regards,
Dmjpro.
Oct 3 '07 #5

FullyH3ktik
P: 52
you just use the onclick event, and the names of the windows:
[HTML]<input type="button" value="Log Out" onclick="win1.close();win2.close();etc" />[/HTML]
Oct 3 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.