Hide TOC button in selected pages | XM Community
Question

Hide TOC button in selected pages

  • 16 April 2024
  • 1 reply
  • 8 views

Badge +1

How do I hide the TOC button in some pages? This button is now between my back page and next page buttons. Thank you!


1 reply

Userlevel 4
Badge +7

Hi @ABA1 ,

 

You can use JavaScript within the survey to achieve this.

 

Find out the IDs of the pages where you want to hide the TOC button by inspecting the HTML of the page.

Use below JavaScript to target the specific pages by their IDs and hide the TOC button on those pages.

//JavaScript Code//

 

Qualtrics.SurveyEngine.addOnload(function() {
    // Array of page IDs where you want to hide the TOC button
    var pagesToHideTOC = ["page1", "page2", "page3"]; // Replace these with actual page IDs

    // Get the current page ID
    var currentPageID = this.questionId;

    // Check if the current page ID is in the array of pages to hide TOC
    if (pagesToHideTOC.indexOf(currentPageID) !== -1) {
        // Hide the TOC button
        jQuery("#MobileNextButton").css("display", "none"); // Replace "MobileNextButton" with the actual ID of your TOC button
    }
});

 

Thank you!

 

Leave a Reply