How to Suppress 'Leave Site?' alert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 12:11 PM
I have created a client script that asks the user if they would like to confirm the submission of a record, if they click cancel on my ui page it should redirect them back to the list view for the table.
im running into an issue where the leave site pop-up still appears because they have unsaved changes to the record and are trying to leave the page.
Is it possible to suppress this Leave Site pop-up or confirm the redirect through the client script to save the user an extra click?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 01:17 PM
Does this help?
Alert is displayed because somewhere on your code, you are overriding the window before unload event, and when you try to close the window, the event fires. Try disallow this event putting up this on your code:
window.onbeforeunload = null;