How to change textbox size of "Allow Text Entry" in an MC question | XM Community
Skip to main content
Question

How to change textbox size of "Allow Text Entry" in an MC question

  • October 20, 2023
  • 3 replies
  • 1009 views

Forum|alt.badge.img+1

Hi,

With “Allow Text Entry” for MC options, it only allows small/medium/large textbox size. How can I adjust the textbox size? I’d like it to be 1 line’s height and longer width. 

 

I tried the code from this post but it doesn’t work

 

Is it correct to right-click the textbox for “Add Javascript”

 

Should I paste the code here?

 

Thanks.

3 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • October 20, 2023

Try using the below code in the JS:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

jQuery("#"+this.questionId+" .InputText").css("width","100%");

});

 


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • October 20, 2023

Hi Shashi, thanks for helping. However, it doesn’t work on the live view. Would you suggest any other solution? Thanks a lot. @Shashi 

 


Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • October 20, 2023

Try below code:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

jQuery("#"+this.questionId+" .TextEntryBox").css("width","100%");
jQuery("#"+this.questionId+" .InputText").css("width","100%");

});