Question
HCL Technologies Limited
IN
Last activity: 25 Jul 2022 14:04 EDT
I want a warning when navigating away from a page to ensure unsaved edits/changes are not lost
Hi Everyone, Hope all are doing good ! I need support on below requirement. How to display pop-up in browser, if user accidentally clicks on close button "X" of the current browser tab or whole browser tab which is presented on top right side of any browser. I tried one of the scenario of Js script as below:
"
window.onbeforeunload = function (close) { close = close || window.event;
if (close) { close.returnValue = ' Data not saved ! Close ?'; } return 'Data not saved ! Close ?'; };
"
I wrote this code in js file and included that js file in scripts section in my application Harness. But it's not working for all Harnesses. So, is there any other way to meet my requirement in Pega.