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

Add repeat headers/labels to Slider question


Badge +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

icon

Best answer by Shashi 11 May 2023, 13:36

View original

4 replies

Userlevel 6
Badge +27

Use below code:

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

 

Badge +4

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?

Userlevel 6
Badge +27

The code should be paste as below:

 

Badge +4

The code should be paste as below:

 

That works! Marvelous, thanks @Shashi 

Leave a Reply