Text entry box in a multiple choice question - is it possible to have it beside instead of below? | XM Community
Skip to main content
Solved

Text entry box in a multiple choice question - is it possible to have it beside instead of below?

  • March 17, 2020
  • 4 replies
  • 114 views

I have a multi-choice question with the last option being "Other (please specify)" with a text box. This text box appears below the text. Is it possible to have it beside instead?

Best answer by rondev

Try using below code in JS onReady jQuery("#"+this.questionId+" .TextEntryBox").each(function() { var tb = jQuery(this); tb.css({"float":"none","background-color":"white","width":"50%"}); tb.prev("label").css("display","block").append(" ").append(tb); });

4 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • March 18, 2020
Try using below code in JS onReady jQuery("#"+this.questionId+" .TextEntryBox").each(function() { var tb = jQuery(this); tb.css({"float":"none","background-color":"white","width":"50%"}); tb.prev("label").css("display","block").append(" ").append(tb); });

  • Author
  • March 18, 2020
This worked perfectly! Thank you so much @rondev !

Forum|alt.badge.img
  • August 14, 2020

This works super well when using a small text entry box, however not when I make a medium text entry box. I've tried increasing the QuestionBody height, but this also doesn't seem to work. Any ideas rondev?
Thanks!!


Forum|alt.badge.img+1
  • January 30, 2021

https://www.qualtrics.com/community/discussion/comment/23216#Comment_23216This code works perfectly on a normally displayed question. However, if I try to use it on a question that has in-page display logic (only gets shown if a specific answer in a previous question on the same page is chosen) it does not work.
More specifically: the background colour and width still works, but the "placing the TextEntryBox BEHIND, NOT BELOW the text does not work
Any idea why and how I can make it work? Thanks!!!