save form data when leaving page without submit

Discussion in 'Javascript' started by Marco Alting, Oct 31, 2003.

  1. Marco Alting

    Marco Alting Guest

    Hi,

    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
     
    Marco Alting, Oct 31, 2003
    #1
    1. Advertising

  2. Marco Alting

    Dave Vick Guest

    Marco,

    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
     
    Dave Vick, Oct 31, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    6,370
  2. subhadip
    Replies:
    0
    Views:
    674
    subhadip
    Mar 28, 2007
  3. Cal Who
    Replies:
    2
    Views:
    312
    Cal Who
    Apr 13, 2010
  4. Jamie Jackson

    Warn to Save before leaving a page...

    Jamie Jackson, Oct 9, 2003, in forum: Javascript
    Replies:
    5
    Views:
    168
    Jamie Jackson
    Oct 10, 2003
  5. Replies:
    2
    Views:
    400
Loading...

Share This Page