Disable message prompt with Table of Contents feature | XM Community

Disable message prompt with Table of Contents feature

  • 26 October 2022
  • 6 replies
  • 108 views

Userlevel 1
Badge +2

How can I disable this message prompting on my screen.
image.png


6 replies

Userlevel 7
Badge +35

robi_kalinisan
It can be disabled via JS but I would not recommend it as if a person is stuck just because they haven't submitted on or the other sections. He will never know and willl leave the survey causing loss in response rate and bad feedback and much more.

Userlevel 7
Badge +27

Hi there, if you want to try the option of disabling the message prompt or changing the text that gets displayed, I explored this a bit in this thread.

Userlevel 7
Badge +27

Since the thread I linked to is unavailable right now, below is the solution it contained.

So while I am not sure how to 'prevent' the error message from displaying, I do have code to hide the page effects + dialog and click the "Go Back" button of the dialog. To give it a try, add the below CSS to the Style section of the survey's Look & Feel:

.JFEScope body.Inactive:before, .JFEScope body.OverlayTransitioning:before {
display: none !important;
}

.JFEScope .PageErrorDialog {
visibility: hidden !important;
}

Then, add the below to the survey's Header:

<script>
jQuery("#PreviousButton").click(function() {
setTimeout(function() {
jQuery("#Page > div > div.PageErrorDialog.TOC > div.ErrorButtons > button:nth-child(1)").click();
}, 5);
})
</script>

Also, if you wanted to change the message that displays on this dialog, the below can be added to the survey's Header instead:

<script>
jQuery("#PreviousButton").click(function() {
setTimeout(function() {
jQuery("#ErrorMessage > span").html("message");
}, 5);
})
</script>

 

Badge +2

HI @Tom_1842 -

I know it’s been a  bit since this was posted, but I was able to use it to disable the prompt - thank you! However, I am now sometimes encountering the issue that when a user clicks the back button, there is an endless spinning wheel - and it never goes back to the former page. Any idea how to trouble shoot this? Many thanks in advance!

Userlevel 7
Badge +27

@DKICM hmm my hunch is that the piece of code that clicks the "Go Back" button of the hidden dialog might need more than 5ms after the PreviousButton click to work consistently. Try updating like the below:

<script>
jQuery("#PreviousButton").click(function() {
setTimeout(function() {
jQuery("#Page > div > div.PageErrorDialog.TOC > div.ErrorButtons > button:nth-child(1)").click();
}, 500);
})
</script>

 

Badge +2

@Tom_1842 That seemed to work - thank you so much!

Leave a Reply