Matrix table text entry wrapping text | XM Community
Question

Matrix table text entry wrapping text

  • 19 June 2020
  • 6 replies
  • 571 views

Hello,
I have the following code to help me increase the matrix table text box height and width. I am looking for a way to text wrap. Can anyone help me with the code to help it wrap. I have tried various forms of break-word, overflow-wrap, wrap-word. I have not coding knowledge, I just use forums like this to find the code that I want.
Thank you,
Lori
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery("#"+this.questionId+" input[type='text']").css("width","12em")
jQuery("#"+this.questionId+" input[type='text']").css("height","5em")


6 replies

Userlevel 7
Badge +27

Input elements don't wrap. You need a textarea element instead of input type=text. You could add textareas and hide inputs with JS. Then have the JS copy/convert the textareas to the corresponding input elements.

Userlevel 7
Badge +27

Hi there, if anyone still needs, I was able to follow TomG's recommendation and have put the below code together:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});


Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

jQuery("#"+this.questionId+" td input").each(function () {
       jQuery(this).hide();
       var txtarea = jQuery("