Add % sign on scale of a constant sum slider question | XM Community
Skip to main content
Question

Add % sign on scale of a constant sum slider question

  • April 9, 2022
  • 1 reply
  • 287 views

Dear community,
for my survey, I have a constant sum question which needs to sum up to 100%.
As an answer type, I chose the slider.
Now, I want to add a % sign after each number on the scale. Does anyone know how to do it? Is there a Java script available?
Thank you very much!!

1 reply

Rudi
QPN Level 3 ●●●
Forum|alt.badge.img+16
  • QPN Level 3 ●●●
  • April 11, 2022

hi Sabine_sn

you could try this JavaScript

Qualtrics.SurveyEngine.addOnload(function()
{
//add the percentage sign
let ri = document.getElementsByClassName('ResultsInput')

for(i=0;i
if(ri[i].attributes.type.nodeValue == "text"){


ri[i].insertAdjacentHTML('afterend', ' %

');

}

}

//decrease size of the input field so that there is no break between field and %
let ip = document.getElementsByTagName('input')

for(i=0;i if(ip[i].id != "NextButton"){
ip[i].style.width = "2.2em";
}
}

});

Best regards

Rudi