Corpcatalog Posted May 23, 2019 Report Share Posted May 23, 2019 Hi I want to warn my user with a dialog box if they click close the browser before submitting their datapage. Ie- do you want to save your data? close dialog and hit submit or no close without submitting. Any help with a Java script or other method for this? Quote Link to comment Share on other sites More sharing options...
0 SunakoChan Posted May 23, 2019 Report Share Posted May 23, 2019 Hi @Corpcatalog, Add Header and Footer on your DataPage and paste the Script below (Make sure that you disable your HTML editor before pasting the code). <script> window.onbeforeunload = function (e) { e = e || window.event; if (e) { e.returnValue = 'Sure?'; } return 'Sure?'; }; </script> Here the expected result: I hope this helps. Corpcatalog 1 Quote Link to comment Share on other sites More sharing options...
0 SunakoChan Posted May 23, 2019 Report Share Posted May 23, 2019 Hi - Just to add, you can check this link for the script: https://stackoverflow.com/questions/10311341/confirmation-before-closing-of-tab-browser. Quote Link to comment Share on other sites More sharing options...
Question
Corpcatalog
Hi
I want to warn my user with a dialog box if they click close the browser before submitting their datapage.
Ie- do you want to save your data? close dialog and hit submit or no close without submitting.
Any help with a Java script or other method for this?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.