Question about percentages in slider | XM Community
Skip to main content
Solved

Question about percentages in slider

  • December 7, 2021
  • 4 replies
  • 836 views

Forum|alt.badge.img

Hi, I have a slider question in my survey where I want the respondent to estimate a threat with a .. % change of .... What is initially shown (without JavaScript) on the slider is just numbers from 0 to 100. To add % to the numbers, I checked out the community. I got some codes, but neither of them work in the right way.
If I use this code:
jQuery("#"+this.questionId+" .numbers li").each(function(){

jQuery(this).text((jQuery(this).text()+"%").trim().replace(" ",""));

});
I get two times the % symbol (0%%). How can I delete one? Or am I using the code in the wrong way?

Best answer by rondev

Remove the code from OnReady and OnUnload functions.

View original

4 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1449 replies
  • December 25, 2021

The code is correct, please send the screenshot to see where you have pasted the code and how it looks,


Forum|alt.badge.img

Javascript.pngI hope you can read it!


rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1449 replies
  • Answer
  • January 3, 2022

Remove the code from OnReady and OnUnload functions.


Forum|alt.badge.img

That worked. Thank you so much.


Leave a Reply