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

Add label to the right of Star-Scale Question

  • 26 November 2019
  • 3 replies
  • 95 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!

!
icon

Best answer by C_Bohn 5 December 2019, 20:59

View original

3 replies

Userlevel 3
Badge +2
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>
That worked flawlessly.

Thanks so much!


Leave a Reply