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

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!!

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


Leave a Reply