473,769 Members | 7,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to prevent closing a child window wthout closing Parent window

1 New Member
Hi all,

1) i opened a parent window.
2) then i opend a child window thruogh this parent window.

Now i want to close child window before closing the parend window
means my clients can not be close the parent window without closing the child window.

please reply me.
if there is any solution for this....

thanks

Arvind Kumar
Feb 26 '07 #1
2 2179
dorinbogdan
839 Recognized Expert Contributor
use an array of references to the child windows, like:

Expand|Select|Wrap|Line Numbers
  1. var childs = [];
  2. ...
  3. var childs[childs.length] = window.open("child1.htm")
  4. ...
  5. var childs[childs.length] = window.open("child2.htm")
  6. ...
  7. var childs[childs.length] = window.open("child3.htm")
  8.  
then set a function to the "onunload" event of the parent window, like:
Expand|Select|Wrap|Line Numbers
  1. function unloadChilds(){
  2. for (var i=0; i<childs.length;i++){
  3.  childs[i].close();
  4. }
  5. }
Feb 26 '07 #2
ashish ranjan
15 New Member
Hi,

If u r working on windows application,U should try Form2Obj.ShowDi alog()







use an array of references to the child windows, like:

Expand|Select|Wrap|Line Numbers
  1. var childs = [];
  2. ...
  3. var childs[childs.length] = window.open("child1.htm")
  4. ...
  5. var childs[childs.length] = window.open("child2.htm")
  6. ...
  7. var childs[childs.length] = window.open("child3.htm")
  8.  
then set a function to the "onunload" event of the parent window, like:
Expand|Select|Wrap|Line Numbers
  1. function unloadChilds(){
  2. for (var i=0; i<childs.length;i++){
  3.  childs[i].close();
  4. }
  5. }
Mar 5 '07 #3

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

Similar topics

10
9809
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
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...
1
5822
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the MDI child window. My application does certain logic when the user actually closes the MDI child form by clicking the "X" in the upper right hand. My application, however, should not execute this logic if the user closes the MDI parent. I...
4
4257
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform some operation . Once the operation is done, i have to close the child window, and refresh the parent window automatically. I am able to close the child window automatically , But not able to refresh the parent window.
4
6972
by: jon morgan | last post by:
Hello, In an MDI application how can I prevent the CLR automatically merging a child windows' menu with that of the parent MDI form ? Thanks for any help Jon
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...
1
7637
by: jd | last post by:
Hi guys, I'm trying to create an HTML page that contains two frames. The bottom frame should simply be some website, but the top frame needs to have a close link to kill the window. I tried calling 'document.window.close()' from the child frame, but without success. I then tried putting the 'close()' call in the parent page and calling it from the child, but still without success. Can anyone take a look at the HTML/Javascript below and...
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
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
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
10049
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...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
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...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5309
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...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.