Removing TOC "Confirm Navigation" pop-up | XM Community
Skip to main content
Question

Removing TOC "Confirm Navigation" pop-up

  • March 24, 2020
  • 4 replies
  • 89 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

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • March 25, 2020
You can hide the Back button like this: ``` this.hidePreviousButton(); ```

  • Author
  • 1 reply
  • March 25, 2020
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?

Forum|alt.badge.img+1
  • 24 replies
  • August 3, 2020

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


JohannesCE
Level 6 ●●●●●●
Forum|alt.badge.img+12
  • Level 6 ●●●●●●
  • 144 replies
  • December 19, 2023

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.