Change width of text entry box in a Multiple chocie answer with text entry | XM Community
Skip to main content
Solved

Change width of text entry box in a Multiple chocie answer with text entry

  • March 17, 2021
  • 3 replies
  • 391 views

Forum|alt.badge.img

Hi all,
I'm using the below Javascript code to move the text entry box to the right of the answer box, but I also want to change the width. Changing the width in % or px in the code doesn't seem to change the actual width of the entry boxes. Also, if I choose the larger entry box options for the type of text entry boxes, the whole thing breaks down and the box is put underneath.
Qualtrics.SurveyEngine.addOnReady(function()
{
    jQuery("#"+this.questionId+" .TextEntryBox").each(function() {
      var tb = jQuery(this);
      tb.css({"float":"none","background-color":"white","width":"100px"});
      tb.prev("label").css("display","block").append(" ").append(tb);
  });

});
This produces:
example.pngBut I want the entry box to be about 3-4 times wider.

Any help would be appreciated. Thanks!

Best answer by JeffD

Ok, problem is likely solved. It turned out we had an override setting (!important) in our css somewhere, and the trick was to override this again with a question specific setting.

3 replies

Forum|alt.badge.img
  • Author
  • Answer
  • March 17, 2021

Ok, problem is likely solved. It turned out we had an override setting (!important) in our css somewhere, and the trick was to override this again with a question specific setting.


Forum|alt.badge.img+4
  • Level 1 ●
  • February 6, 2022

Hi JeffD
I realise you posted this a while ago but could you let me know how to make the width of multiple choice txt boxes wider please?
I don't want the text box beside the question but would like to make it wider. Thank you


Forum|alt.badge.img
  • Author
  • February 9, 2022

Hi PAZ,
You can use the javascript I posted above to edit the width of boxes on individual items. You can also edit the style headers. Sorry I can't be more specific than that, it's been a while since I've worked on this problem.