Hello,
I have the CSS code to help me increase the matrix table text box height and width. I am however looking for a way to text wrap and start the text in the top line of the box (not the middle of the box which seems to be default). Can anyone help me with the css code to help with this please?
Thanks in advance.
Hi there, this is similar to the question posed in this thread, where TomG mentions that these fields are input fields which do not wrap. I was able to follow his recommendation and put together code that will hide the input fields and create textarea fields in their place, saving the values back to the input fields on page submit. The full JS is below:
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("");
txtarea.attr("id", this.id+"txtarea");
jQuery(this).before(txtarea);
});
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{
/*Place your JavaScript here to run when the page is unloaded*/
jQuery("#"+this.questionId+" td input").each(function () {
let text;
let textarea = document.getElementById(this.id+"txtarea");
text = textarea.value;
jQuery(this).val(text);
});
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.