prevent exit from page without saving

Results 1 to 2 of 2

Thread: prevent exit from page without saving

  1. #1 Guest

    Default prevent exit from page without saving

    Does anyone have any suggestions for me on this problem??<BR><BR>I have a form within an ASP page that, upon exit (by any link) I would like to:<BR>-check to determine if any changes have been made to the form;<BR>-if there have been changes, validate/check that the save button has been selected to save changes;<BR>-if changes haven&#039;t been saved, return false preventing the exit and display an alert to the user.<BR><BR>I was anticipating using javascript for this task. But I am uncertain how to handle a couple of items...<BR>-I know how to validate forms for blanks or allowable characters, but how do I test for any changes (there may already be text in field or it may be updated)?<BR>-Will a return false work when trying to exit from any link?<BR><BR>Any thing else that I should consider?<BR><BR>Any help or ideas would be greatly appreciated.<BR><BR>Joe<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: prevent exit from page without saving

    You could do this, but you risk the fact of pissing your users off since they can&#039;t do what they want...<BR><BR>&#060;A HREF="#" onclick="doSomething();"&#062;<BR><BR>Then, in your &#039;doSomething&#039; routine, do your checks... if successful, send &#039;em where they want to go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts