Add label to the right of Star-Scale Question | XM Community
Skip to main content
Solved

Add label to the right of Star-Scale Question

  • November 26, 2019
  • 3 replies
  • 161 views

Hi All, I'm working with the scale question and want to get a second label added to the right of the scale. I wasn't able to find an option for this, is there a way to create a code for this? Thanks in advance! !

Best answer by C_Bohn

You will want to insert some JS into the question. Click the gear icon (Advanced Question Options) to the left of the question. Select "Add JavaScript". Insert the following where appropriate under the "Qualtrics.SurveyEngine.addOnload..." section. <code>Qualtrics.SurveyEngine.addOnload(function() { var questionId = this.questionId; var choiceInputs = $$('#'+this.questionId + ' .ChoiceStructure input'); for (var i=0; i < choiceInputs.length; i++) {var choiceInput = choiceInputs[i]; try {if (choiceInput && choiceInput.parentNode) {choiceInput.parentNode.appendChild(QBuilder('span',{},'after star text here')); } } catch(e) { } } }); </code>

3 replies

C_Bohn
Level 2 ●●
Forum|alt.badge.img+2
  • Level 2 ●●
  • Answer
  • December 5, 2019
You will want to insert some JS into the question. Click the gear icon (Advanced Question Options) to the left of the question. Select "Add JavaScript". Insert the following where appropriate under the "Qualtrics.SurveyEngine.addOnload..." section. <code>Qualtrics.SurveyEngine.addOnload(function() { var questionId = this.questionId; var choiceInputs = $$('#'+this.questionId + ' .ChoiceStructure input'); for (var i=0; i < choiceInputs.length; i++) {var choiceInput = choiceInputs[i]; try {if (choiceInput && choiceInput.parentNode) {choiceInput.parentNode.appendChild(QBuilder('span',{},'after star text here')); } } catch(e) { } } }); </code>

  • Author
  • December 11, 2019
That worked flawlessly. Thanks so much!

  • October 2, 2020