473,378 Members | 1,699 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,378 software developers and data experts.

How can I warn a user they are about to navigate away from a page

I have a set of webforms where I need to prompt the user to "Save Changes".
I can handle this to a degree within the form but if the user presses the
Back button or selects the Home button the data can be lost.

I have tried using javascript but that only seems to capture an event
signalling that you are leaving the page, I want something that is fired
before it navigates away. I have tried using blur events but they fire when
I switch to another window.

Has anyone out there encountered this or come up with a solution to this.

Thanks

Tone
Nov 18 '05 #1
4 1585
not really. This of it this way, if you could you could stop somone from
EVER leaving...that wouldn't be good. You can have a dialog on the controls
in your page easy enough but not stopping the actual browser controls......

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Tone Curtis" <to**@hoocha.com> wrote in message
news:uj**************@TK2MSFTNGP11.phx.gbl...
I have a set of webforms where I need to prompt the user to "Save Changes". I can handle this to a degree within the form but if the user presses the
Back button or selects the Home button the data can be lost.

I have tried using javascript but that only seems to capture an event
signalling that you are leaving the page, I want something that is fired
before it navigates away. I have tried using blur events but they fire when I switch to another window.

Has anyone out there encountered this or come up with a solution to this.

Thanks

Tone

Nov 18 '05 #2
not really. This of it this way, if you could you could stop somone from
EVER leaving...that wouldn't be good. You can have a dialog on the controls
in your page easy enough but not stopping the actual browser controls......

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Tone Curtis" <to**@hoocha.com> wrote in message
news:uj**************@TK2MSFTNGP11.phx.gbl...
I have a set of webforms where I need to prompt the user to "Save Changes". I can handle this to a degree within the form but if the user presses the
Back button or selects the Home button the data can be lost.

I have tried using javascript but that only seems to capture an event
signalling that you are leaving the page, I want something that is fired
before it navigates away. I have tried using blur events but they fire when I switch to another window.

Has anyone out there encountered this or come up with a solution to this.

Thanks

Tone

Nov 18 '05 #3
"Tone Curtis" <to**@hoocha.com> wrote in message
news:uj**************@TK2MSFTNGP11.phx.gbl...
I have a set of webforms where I need to prompt the user to "Save Changes". I can handle this to a degree within the form but if the user presses the
Back button or selects the Home button the data can be lost.

I have tried using javascript but that only seems to capture an event
signalling that you are leaving the page, I want something that is fired
before it navigates away. I have tried using blur events but they fire when I switch to another window.

Has anyone out there encountered this or come up with a solution to this.


I'm afraid that the solution to this problem is to not use a web
application. This is not what web applications do.

What would you do if the user closed the browser? What if he turns off his
computer?
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4
Thanks for the advice. That makes perfect sense.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:O1**************@tk2msftngp13.phx.gbl...
not really. This of it this way, if you could you could stop somone from
EVER leaving...that wouldn't be good. You can have a dialog on the controls in your page easy enough but not stopping the actual browser controls......
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Tone Curtis" <to**@hoocha.com> wrote in message
news:uj**************@TK2MSFTNGP11.phx.gbl...
I have a set of webforms where I need to prompt the user to "Save

Changes".
I can handle this to a degree within the form but if the user presses the Back button or selects the Home button the data can be lost.

I have tried using javascript but that only seems to capture an event
signalling that you are leaving the page, I want something that is fired
before it navigates away. I have tried using blur events but they fire

when
I switch to another window.

Has anyone out there encountered this or come up with a solution to this.
Thanks

Tone


Nov 18 '05 #5

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

Similar topics

2
by: Richard Bell | last post by:
Newbie question ... please respond to group I'm trying to open/navigate to a url. How can I tell when the page is fully loaded? Testing suggest that window.open returns before the page is...
3
by: sancha | last post by:
Hi, I need to promt the user when he moves away from the page by clicking an of the links available on the page. I was trying to use the onbeforeunload function but it seems it is a jScript...
0
by: tafs7 | last post by:
Hello, I have a custom datagrid control that works great. But I was thinking about adding some functionality to it. Currently, I use the datagrid to display one record at a time, and with item...
0
by: Tone Curtis | last post by:
I have a set of webforms where I need to prompt the user to "Save Changes". I can handle this to a degree within the form but if the user presses the Back button or selects the Home button the data...
4
by: markalroberts | last post by:
Hi, I wish to ask warn the user that there are unsaved changes (if there are) and allow them to cancel navigating away/closing the browser. Investigation leads me to believe the...
2
by: tshad | last post by:
User VS 2003, I would like to use User Controls to control the page look with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and PageBottom.ascx). I would put the Content User control...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
6
eragon
by: eragon | last post by:
I've been developing a hit counter that uses ajax and PHP to display an accurate readout of exactly how many users are currently viewing a specific page. It adds to to the count when a user loads the...
103
by: Tom | last post by:
How do we get out of the browser infinite loop quicksand when we navigate to web pages designed to lock us in and force us to hit the "pay me" button (whatever they want to force you to do)? ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.