473,773 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

closing a child window on logout

92 New Member
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
5 4112
Atli
5,058 Recognized Expert Expert
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
16,027 Recognized Expert Moderator MVP
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
backups2007
92 New Member
How do I make a reference to other windows?
Oct 3 '07 #4
dmjpro
2,476 Top Contributor
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
52 New Member
you just use the onclick event, and the names of the windows:
[HTML]<input type="button" value="Log Out" onclick="win1.c lose();win2.clo se();etc" />[/HTML]
Oct 3 '07 #6

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

Similar topics

5
2261
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here is to ensure that no child window can close while it is in a state where user entered information can be lost. I have just noticed that while the Closing event is caught if I click the X on the child window, it is not caught if I click the X on...
10
4029
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
5
1191
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here is to ensure that no child window can close while it is in a state where user entered information can be lost. I have just noticed that while the Closing event is caught if I click the X on the child window, it is not caught if I click the X on...
4
3181
by: reemamg | last post by:
From a parent window a new child window is open with window.open <script type="text/javascript" language="JavaScript" > function abc() { if(window.event.clientY <0 && window.event.clientY <-80 ) { if (win2 && !win2.closed) // win 2 is the child window
5
3082
by: Nithu25 | last post by:
Hi All, I have a parent window where i have three links. On clicking those links, new window will be opened as a pop up. When i logout from the parent window, the child windows should be closed. I can close the child windows when i close the parent window using the following code The following function i am calling "onUnload" event in the body tag of parent window.
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.