Solved

Need to handle close event of window without any alert message

Posted on 2007-11-17
5
1,319 Views
Last Modified: 2008-02-20
Hi Experts,

I have a main window and a pop up from the main window. I made the  popup window like ModalDialog by keeping the focus always on popup window when the user moves to main window. This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). I controlled all the events of main window and made the popup to behave as actual modal, But i am not able to handle the events of main window close (X), maximize and minimize. Means even though i have my focus on popup window, i am able to close the main window by clicking 'X'. Is there any way that i can handle the event of 'X' and show my popup window back. I tried 'onbeforunload' but it is asking a confirmation alert from the user. I should NOT show any confirmation from main window and i want to focus the user back to popup window if the user click 'X' of main window. I hope there is solution for this. Thanks in advance
0
Comment
Question by:jayend_expert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 168 total points
ID: 20311416
there is no way to handle system (OS) event like the window close from within a web page 'cause it violates the sandbox policy, not sure if ActiveX can do it ..
0
 
LVL 17

Assisted Solution

by:gops1
gops1 earned 166 total points
ID: 20338428
Why do not you use a customized modal
You can refer this site:
http://gabrito.com/post/enhancements-to-submodal

or google for "Submodal" and you get plenty of them
0
 
LVL 16

Assisted Solution

by:LeeKowalkowski
LeeKowalkowski earned 166 total points
ID: 20567796
"This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). "

- If the modal dialog won't execute some of your activeX script, then your main window won't either.  Otherwise there's nothing stopping you from putting your activeX script in your main window and invoking it from your modal dialog, but it should work in your modal dialog too, perhaps you're doing something else wrong.

--
Lee
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20943727
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Duplicate Elements with JS / jQuery 3 24
Building JSON/JQuery Results Display 11 27
Can anyone help me find this preloader? 51 43
Boolean 13 24
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question