Add repeat headers/labels to Slider question | XM Community
Skip to main content
Solved

Add repeat headers/labels to Slider question

  • May 11, 2023
  • 4 replies
  • 611 views

Forum|alt.badge.img+4

Hi,

I am trying to add repeat headers (known as labels in “format”) to my Slider question.

Has anyone got a JavaScript I can paste in?

Thanks,

D

Best answer by Shashi

The code should be paste as below:

 

4 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • May 11, 2023

Use below code:

	jQuery("#"+this.questionId+" ul.labels").clone().insertBefore("#"+this.questionId+" .slider-container:not(:eq(0))")

 


Forum|alt.badge.img+4
  • Author
  • Level 2 ●●
  • May 11, 2023

Use below code:

	jQuery("#"+this.questionId+" ul.labels").clone().insertBefore("#"+this.questionId+" .slider-container:not(:eq(0))")

 

Hi, thanks for the suggestion. It doesn’t seem to work when I preview it after I inputted this to the “Edit Question JavaScript”, which resulted in the entire script saying:

 

 

Qualtrics.SurveyEngine.addOnload(function()
{
    /*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
    /*Place your JavaScript here to run when the page is unloaded*/

});


jQuery("#"+this.questionId+" ul.labels").clone().insertBefore("#"+this.questionId+" .slider-container:not(:eq(0))")

 

 

 

Any other suggestions?


Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • Answer
  • May 11, 2023

The code should be paste as below:

 


Forum|alt.badge.img+4
  • Author
  • Level 2 ●●
  • May 11, 2023

The code should be paste as below:

 

That works! Marvelous, thanks @Shashi