Re: Stopping navigation away from the page



On Jan 31, 5:26 pm, Stevo <ple...@xxxxxxxxxxx> wrote:
Yash wrote:
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.

That sounds like a bad idea. Why would you want to not allow a user to
leave ? I agree catching them and asking if they're sure they want to
abandon what they were doing is a good idea, but preventing them from
doing it doesn't sound sensible.

I want to present only an OK because the user should be made aware of
why he is not being allowed to leave. When he cliks OK, he will be
back on the page.

There will be special flag set onclick of the Submit button to exempt
it from the above check. So only on Submitting, the user will be able
to leave the page.

This is a client requirement and we have no control over it.
.


Quantcast