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

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


Forum|alt.badge.img+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!

Best answer by ArunDubey

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%");
});

 

View original

3 replies

ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • 589 replies
  • Answer
  • December 5, 2023

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%");
});

 


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • December 5, 2023

Dear Arun Kumar Dubey, 

your solution worked perfectly! Thank you so much!

Best, 

Max 


ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • 589 replies
  • December 5, 2023
Max33 wrote:

Dear Arun Kumar Dubey, 

your solution worked perfectly! Thank you so much!

Best, 

Max 

Great, all the best @Max33 !!


Leave a Reply