Qualtrics side by side question format | XM Community
Skip to main content

I have the code to left align my text box answers but don’t know how or where to insert the java script

 

Please help

 

@culka594 Left-side bar, scroll down to the bottom you will see the option to add Java Script. Write your code in it and save.
 

 


thank you for your help 

 

I don’t know java script -  this is the code I was given

Qualtrics.SurveyEngine.addOnload(function() {



    // Replace 'QID3' with your actual Question ID



    var questionId = 'QID3';



    



    var inputs = document.querySelectorAll('#'+ questionId + ' inputotype="text"], #' + questionId + ' inputotype="number"], #' + questionId + ' textarea');

    inputs.forEach(function(input) {



        input.style.textAlign = 'left';



    });



});


how do I insert it - do I put the whole lot in?

 


@culka594 Your code need the QID from Qualtrics but since you dont know Code so I make you a better version.

Qualtrics.SurveyEngine.addOnload(function() {

var questionContainer = this.getQuestionContainer();
var inputs = questionContainer.querySelectorAll('inputttype="text"], inputttype="number"], textarea');
inputs.forEach(function(input) {
input.style.textAlign = 'left';
});

});


Just replace the whole thing with the code


I WISH I COULD GIVE YOU A BIG HUG

😘


I WISH I COULD GIVE YOU A BIG HUG

😘

These are the types of XM Community interactions we love to see 😀


Leave a Reply