Removing TOC "Confirm Navigation" pop-up | XM Community
Question

Removing TOC "Confirm Navigation" pop-up

  • 24 March 2020
  • 4 replies
  • 56 views

I have designed a survey in which I am using TOC feature. A pop-up comes up whenever I click on "Back" button, on the pages that comes under TOC. Can we remove this or hide this using custom script?

4 replies

Userlevel 7
Badge +27
You can hide the Back button like this:
```
this.hidePreviousButton();
```
Thank you for your response. But my client has specifically asked for "Back" button on all the pages. The only thing I want to hide right now is "Confirm navigation" pop-up. Is there any way I can hide it?
Badge +1

Hi Tanu!
I came across with the same question. By any chance you have figured out how to turn it off?

Userlevel 6
Badge +12

I managed to do this with a JS in the header:

    // Script to automatically click "Go Back" in the error dialog
(function() {
function closeErrorDialog() {
var dialog = document.querySelector('.PageErrorDialog.TOC');
var goBackButton = dialog ? dialog.querySelector('.ErrorButtons button:first-child') : null;

if (dialog && goBackButton) {
goBackButton.click();
}
}

setInterval(closeErrorDialog, 500); // Check every 500 milliseconds
})();

Note that setting a very short interval can increase the load on the browser, as it will be running the check more frequently.

Leave a Reply