473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to prevent closing a child window wthout closing Parent window

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 2142
dorinbogdan
839 Expert 512MB
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
Hi,

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







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
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
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...
1
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...
4
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...
4
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
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...
1
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...
4
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 &&...
5
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...

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.