By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

save form data when leaving page without submit

P: n/a

I have an HTML form which enters data in an Access database using ASP. But
now my client asked me if it is possible to alert users, when they click a
link other then submit on the page, that there is unsaved data and if they
want to save. If so the page must redirect to the ASP page that writes the
data and then go to the page that they click and if not the page should be
redirected to the link they clicked.

I tried using the onUnload and onBeforeUnload events, but gives me no result

I hope someone can help

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a


When the onUnload event is triggered it is already too late, the page is
already in the process of being unloaded. About the only thin I can
think of would to have all of your links call a confirming function, pop
up a confirm box and then, based on their answer, either stay there or
follow the link. Even then there is the back button, their favorites
list and just plain old closing the browser. Your never going to be able
to cover all of the possiblilites, no matter what type of application it
is and a web app is even harder. Just make it as robust as possible and,
most likely, after they've done it once, they wont leave it again with
out saving :)

The onBeforeUnloadEvent is MS specific I think only for their JScript.

Hope that helps a little

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.