• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

existing web document without saving

How do I prevent a user from existing the web enabled form without clicking the save button. Currently they can use the backward or forward buttons on the browser to exit without saving or click on any links.
1 Solution

You can use @Command([Fileclosewindow]) to close the document without saving, this action will take him to previous screen from where he started.

Good Luck
pcorreyaAuthor Commented:
I need to prevent them doing this, not letting them exit.
I really doubt that this it is possible to do what you ask but if you want people to at least read your question just in case there is a way, you need to reject HemanthaKumar's answer so that your question is no longer locked.

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

It is impossible to stop someone pressing the back button on there browser or closing your window... It is possible to stop them saving the document without filling in all of the required data using either server side field validation or client side javascript validation , but it is not possible to trap a user at  page ..

 If it was how long do you think the internet would have lasted !!!
pcorreyaAuthor Commented:
This is for an intranet application and we need users to save the data before they go off and do something else.
There is a way to disable the back button of the browser, you should ask this in the Internet forum (or Javascript forum).
With Notes, you can only make sure that before going on the document is saved.
However there is no way to stop users from closing their browser. The only thing you can do is have it automatically save when the user leaves the page if it has not been saved yet.

Close but not exactly what you want might be:
1) open the document in a browser window which has no back/forward/home buttons.
2) Use the VERY annoying technique of re-opening the page if they try and close it. (trap the onunload event in Javascript)

remember a web session is stateless and this sort of thing is dificult to implement in that arena.

Hope it helps,
How can, at least, alert the user that the information he typed would not be saved?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now