Prompt the user to "save changes" before leaving page -

Has anyone tried to implement the onbeforeunload(), specifically for prompting the user to save changes before leaving the page, or in general? I want to add that functionality, but the only way I can see right now to do that is to set a flag on the element(s) that flips on “on change”. Then when the user initiates an action to leave that page (ie through a button or link), check on each of these workflows whether at least one flag has been triggered on that page - if so, show a message and terminate the page nav. This wouldn’t solve the issue for closing the window or browser though.

Anyone figured out a solution? This link below is the closest I could find to match my question,… Create popup if user tries to close app?

This topic was automatically closed after 70 days. New replies are no longer allowed.