How to remove the warning that appears when you use the previous button after adding the ToC element | XM Community
Question

How to remove the warning that appears when you use the previous button after adding the ToC element

  • 11 January 2022
  • 6 replies
  • 176 views

Userlevel 2
Badge +1

Hello,
Can anyone tell me if they know of a way, through the system or maybe with JS of preventing the message pictured below from appearing. It pops up when you use the previous button in a survey that has the Table of Contents element. I never had this message pop up before in this survey, then I added a ToC and now it appears every time you move back.
Alternately, if it cannot be removed, is there a way to change the text?
Thanks!
image.png


6 replies

Userlevel 2
Badge +1

I found this discussion where ahmedA suggests using a mutation observer. My JS skills are not at that level, so if anyone knows how this could be done (to either eliminate the warning message above from appearing or to change the message that it displays), I would greatly appreciate it!

Userlevel 7
Badge +27

Hi there, I have a way to both "prevent" and also change the text of the message that appears when respondents select the previous button when using a Table of Contents. It involves using the Previous button as a trigger and then setting a timeout of 5 milliseconds before performing either the button click or text replacement. Since it uses settimeout, the below will only work with live links, not preview.
First, the window "prevention". I don't know of a way to completely prevent the window from popping up here, but it can be moved to the very back using z-ordering. In your survey's Look & Feel, put the below in the Custom CSS section in the Style tab:
.JFEScope body.Inactive:before, .JFEScope body.OverlayTransitioning:before {
z-index: -999 !important;
}

.JFEScope .PageErrorDialog {
z-index: -999 !important;
}
Then, still in the Look & Feel but over in the General tab, add the below to the survey's Header:


The alternative method that involves changing the text of the message that pops up, don't add any CSS but add the below to the survey's Header:

TOC_ErrorMessage.png

Userlevel 2
Badge +1

Thank you, Tom_1842! I'll try that out.

Badge +2

Result of CSS suppression of navigation error msg.pngI couldn't get either the prevention or relabeling to work. I thought it might be our brand's dynamic theme, so I removed that and all logos, headers, made sure there was no other CSS or styles. It does move the error message box behind the questions, although when resize the screen it pops out. But the problem is the previous button still spins, doesn't move backwards, and message box persists, and now even when the message box is visible, it's "Go Back" button is deactivated. Was worth a shot; I'd really like to be able to suppress this message, have to use ToCs a lot...

Userlevel 7
Badge +27

Hi CarlR , looking back, I think I would adjust the CSS to not display the overlay and to hide the error message instead of using z-ordering. Try adding 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, over in the General section of the Look & Feel, add the below to the Header:

If it helps, it's working for me in the attached qsf
TOC_NoMsg.qsf

Userlevel 7
Badge +38

If anyone else is like me and loved this topic but got frustrated because this string didn’t contain all of the cod you need, don’t worry. @Tom_1842 also posted it here and this post still shows all of the detail you need: 

Thanks Tom!

Leave a Reply