473,405 Members | 2,338 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,405 software developers and data experts.

window.onbeforeunload and postback

I have a function that checks whether the user is trying to navigate away
from the page before saving all their data. I achieve this using the
window.onbeforeunload javascript event. It fires when somone clicks on a
link or button but not when someone changes the selected index of a
dropdownlist or radio button.

I tried registering the following script:
RegisterOnSubmitStatement("submit", "confirmClose;") but it does not fire
when a dropdownlist or radio button list postsback. Any ideas on how to do
this?

Thanks
Jul 21 '05 #1
1 5640
I just read the onbeforeunload reference at:
http://www.msdn.microsoft.com/librar...foreunload.asp
and it states that the event can be invoked using the form submit method. I
checked the '__doPostBack' script and it contains the line
'theform.submit()'.

So I guess it should work...but it doesn't. Any ideas?

"rufus" wrote:
I have a function that checks whether the user is trying to navigate away
from the page before saving all their data. I achieve this using the
window.onbeforeunload javascript event. It fires when somone clicks on a
link or button but not when someone changes the selected index of a
dropdownlist or radio button.

I tried registering the following script:
RegisterOnSubmitStatement("submit", "confirmClose;") but it does not fire
when a dropdownlist or radio button list postsback. Any ideas on how to do
this?

Thanks

Jul 21 '05 #2

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

Similar topics

1
by: ian.michel | last post by:
I have a parent window that pushes a new window object onto an Array with the following code : OpenChild() { //totalNumWindowsCreated is global totalNumWindowsCreated =...
1
by: RJN | last post by:
Hi I have a pop-up window which has a task menu on its left which are nothing but links to different screens. This window also has a close button. On click of close button I do some server side...
4
by: lilfos | last post by:
Hi there, I have an asp.net page with essentially a "don't forget to save" pop-up that is called when the user attempts to navigate away from the page. The user has the option to cancel and...
1
by: tecknick | last post by:
Hi All I am using the window.onbeforeunload event on a webpage as follows : window.onbeforeunload = confirmExit; function confirmExit() { if (changesMade == 1 && needToConfirm) ...
3
by: sonali | last post by:
i want to dopstback should get called on brower's close button click also function closewindow() { if (window.dialogArguments) { // Calling the method (given as argument) to cause the...
1
by: Jason | last post by:
I am creating a Comet/Ajax chatroom system. When people go to the page, it will add them to the list of people in the room via window.onload. When they leave, disconnect, go to another page, or...
3
by: Andrew Poulos | last post by:
There's a HTA application that's running on a local computer (not from a URL) and the user can open a new HTML window by clicking a button The first time the user clicks the button the window...
1
by: sirmoreno | last post by:
Hi, I want to confirm if the user wants to exist the page without any save. my code: <script language="javascript" type="text/javascript"> window.onbeforeunload = confirmExit; function...
29
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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...
0
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,...
0
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...

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.