How to add both % and labels to slider scale questions? | XM Community
Solved

How to add both % and labels to slider scale questions?

  • 5 December 2023
  • 3 replies
  • 62 views

Badge +1

Hi, 

I’m trying to have both labels and % at the extremes of a slider scale but I somehow end up with doubling both. I can only properly use either % or labels at the extremes because otherwise it looks like this: 

I’m using the following javascript code for the % at the extremes: { jQuery("#"+this.questionId+" .first").text((jQuery("#"+this.questionId+" .first").text()+"%").trim().replace(" ",""));
jQuery("#"+this.questionId+" .last").text((jQuery("#"+this.questionId+" .last").text()+"%").trim().replace(" ",""));}

How can I have both the less/more valuable and the % point for the extremes without the doubling?

Thank you in advance!

icon

Best answer by ArunDubey 5 December 2023, 13:38

View original

3 replies

Userlevel 7
Badge +33

if below preview works for you, then try solution.
 

Solution:

first set the labels of 3 scales (first middle and last).
 

 

Then paste the below code under javaScript notepad to replace -100 with -100% and 100 with 100%.

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
jQuery("#"+this.questionId+" .numbers .first").text("-100%");
jQuery("#"+this.questionId+" .numbers .last").text("100%");
});

 

Badge +1

Dear Arun Kumar Dubey, 

your solution worked perfectly! Thank you so much!

Best, 

Max 

Userlevel 7
Badge +33

Dear Arun Kumar Dubey, 

your solution worked perfectly! Thank you so much!

Best, 

Max 

Great, all the best @Max33 !!

Leave a Reply