473,605 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cancel the 'unload' action in 'onbeforeunload ' event

What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.

Jul 23 '05 #1
6 15879
On Mon, 19 Jul 2004 10:13:43 -0400, Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


....Bwa! Ha Haaaa Ha Haaa... good one!
What? ..You're *serious*?

What happens when the user presses these keys?
<http://www.physci.org/kbd.jsp?key=ctr l+alt+del>

[ The 'user must log out' is an FAQ across HTML,
Site-Design, Java, JS... groups. You cannot
*guarantee* a log-out. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
According to dhtml books from o'reilly et al, , this can be done.

Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Jul 23 '05 #3
On Mon, 19 Jul 2004 10:40:08 -0400, Marcia Gulesian wrote:

(force log-out)
According to dhtml books from o'reilly et al, , this can be done.


...and do they mention exactly how, as opposed
to vaguely waving hands about and espousing how
it *should* be possible? You're the one with
the book Marcia, what does it say?

I would be especially interested to hear how
they propose preventing the user from disconnecting
the cable that connects them to the internet,
or turning the computer off at the wall.

OTOH, I thought the c.l.js FAQ might mention
something about it.. ahh yes,
<http://www.jibbering.c om/faq/#FAQ4_29>
and.. back to where I started. 'No'.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
In article <40************ **@theworld.com >, mg@theworld.com enlightened
us with...
According to dhtml books from o'reilly et al, , this can be done.

Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.



Really?
Post the source that gave you the impression that it could be done
*reliably*.

There's a very big difference between "can be done" and "can be done
reliably".

I can do a lot of things that only work in IE6 with javascript enabled
on a windows box with low security settings. Those things are generally
used in an HTA and are useless for much else. This group assumes cross-
browser internet use unless otherwise specified.

--
--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5


Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Well check the documentation, here it is:
http://msdn.microsoft.com/library/de...foreunload.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #6
Thanks!

Martin Honnen wrote:
Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload ' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Well check the documentation, here it is:
http://msdn.microsoft.com/library/de...foreunload.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/


Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2466
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a BeforeUpdate Event Procedure. There is nothing elaborate about the event, however, there is an initial message box stating that if one field contains data then a second one must also, and then after clicking okay, the DoCmdMenuItem action box is...
7
2509
by: MLH | last post by:
I tried the following code to prevent a checkbox from being updated (going from a value of Null to True, from True to False or from False to True). I was surprised it did not work. Can anyone offer a sensible, logical, insightful reason as to why Microsoft does not want to let programmers stop this event? Private Sub NoOwnerInfoChkBox_Click() If CurrentVehicleJobID = 0 Then
6
18417
by: Mike | last post by:
I have a web form in my application that will be used for both viewing and updating information. I have a requirement that if any data has been changed on the page and the user attempts to leave the page without saving, the user gets prompted with a message asking if they want to save changes. It seemed logical to put any code to handle this in the page unload event, however the page unload event gets fired every time the page does a post...
2
1324
by: Michael SL | last post by:
When a client requests to leave a Web Page, I want the web page to check for a certain condition. If that condition is met, I want to prompt the user to make sure they want to leave The method I am currently using is <HTML><HEAD .. <script><!- function PageBeforeUnloadCheck( .. if (...)AdministratorStatusReportSummaryForm.TheReportTypes.value ==
0
1647
by: Joe E. | last post by:
I have a .ASPX page in an iFrame and when the SRC of the iFrame changes the page_unload event does not fire. In order to get this event to fire, I tried using the onbeforeunload event in the body tag to submit the form with javascript. The only problem I have had with this is that IE SP2 does not let you submit onunload or onbeforeunload unless you prompt the user or display some kind of message to the user. Does anyone know a way...
1
4110
by: David | last post by:
I am using a process to warn users when they leave a page that there have been changes made. I took the example directly from Microsoft example I found in searching for help on the event onbeforeunload. I have the event inside the BODY element in my aspx page and it seems to work just fine. However, I still get a flash of a page error in the lower left corner of my browser and the Visual Studio 2005 "souce" page shows the event name...
2
30594
gregerly
by: gregerly | last post by:
I'm working on a corporate intranet site and am trying to create a page that will warn a user on window unload if they have not saved thier work. Basically I just select all inputs, and on change, set var changes = true; On window unload if changes==true, they have made changes that are not yet saved, and I want a confirm box to pop up, asking if they really want to leave or stay on the page? At this point is it to late to cancel the window...
3
3287
by: nareshreddy | last post by:
Hi i am using the below code to close the window and i l get promt when click on 'X' button on ie browser with OK and Cancel buttons. if i click ok window will be closed, if i click cancel window wont close. what i need is if i click ok also it should perform as a cancel and the window should not close. thanks in advance. <SCRIPT FOR = "window" EVENT = "onbeforeunload"> event.returnValue = "If you wish to keep this session...
0
7938
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
8427
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
8298
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
6752
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
5892
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
3914
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
2441
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
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1279
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.