Re: Stopping navigation away from the page
- From: GArlington <garlington@xxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 04:00:21 -0800 (PST)
On Jan 31, 5:22 am, Yash <yas...@xxxxxxxxx> wrote:
Hi,
In our ASP .NET application we present a form wherein the user has to
input a number of fields. If in the middle of filling the form, the
user accidentally navigates away from the page, either by clicking a
link on the page or hitting an entry in the Favorites or in any way,
we want to present an alert with only the OK button, which when
clicked will keep the user on the same page and avoid the navigation
out of the page.
If we do it in the onbeforeunload event, we get a standard popup with
OK and CANCEL. When Cancel is clicked, the user navigates away. We
want to avoid this.
Can you please suggest a way? Is there a way to capture the navigation
event and suppress it?
Thanks,
Yash
1) What is the point in presenting only one option "OK"? Are you
working for early Microsoft (an error occurred - click "OK" to
continue)?
2) If the user does not have a choice then there is NO point in
presenting the box, but you can still use std alert()
3) If you put this script in onUnload event, your user will NEVER be
able to leave the page, or are you going to put some code in Submit
button onClick event to disable the onUnload code?
.
- References:
- Stopping navigation away from the page
- From: Yash
- Stopping navigation away from the page
- Prev by Date: Re: Submitting form via xmlhttp request
- Next by Date: Re: Javascript countdown without refreshing.
- Previous by thread: Stopping navigation away from the page
- Next by thread: Re: Stopping navigation away from the page
- Index(es):