How can I create a vertical line between specific scale points on a multiple choice question? | XM Community
Skip to main content
Solved

How can I create a vertical line between specific scale points on a multiple choice question?

  • March 17, 2022
  • 3 replies
  • 282 views

Forum|alt.badge.img+1

Is anyone familiar with some JavaScript I could use to create a vertical line between specified scale points in a multiple choice question? I've managed to find code that will do this between the last and second-to-last scale items for a matrix question, as below:
image.pngBut I cannot figure out how to:
1) Create the vertical line in a multiple choice question (not a matrix question)
2) Move the position of the vertical line, and include a second line. For instance, I have this scale, and I would like to place a vertical line just to the right and left of the central point.
image.png

Best answer by TomG

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .LabelContainer").eq(2).css({"border-left":"1px solid #666","border-right":"1px solid #666"});
});

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • March 17, 2022

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .LabelContainer").eq(2).css({"border-left":"1px solid #666","border-right":"1px solid #666"});
});


Forum|alt.badge.img+1
  • Author
  • March 17, 2022

https://community.qualtrics.com/XMcommunity/discussion/comment/44657#Comment_44657Thanks Tom!
That works perfect for a couple of my survey questions.
Quick follow up - what if I want just a vertical line to the left of the right-most point? The code I found to do this in matrixes doesn't seem to work for a single multiple choice question.


Forum|alt.badge.img+1
  • Author
  • March 17, 2022

Never mind, I figured it out. Thanks.