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

Qualtrics side by side question format

  • October 4, 2024
  • 5 replies
  • 65 views

Forum|alt.badge.img+1

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

 

5 replies

Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • October 4, 2024

@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.
 

 


Forum|alt.badge.img+1
  • Author
  • 3 replies
  • October 4, 2024

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 + ' input[type="text"], #' + questionId + ' input[type="number"], #' + questionId + ' textarea');

    inputs.forEach(function(input) {



        input.style.textAlign = 'left';



    });



});


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

 


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • October 4, 2024

@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('input[type="text"], input[type="number"], textarea');
inputs.forEach(function(input) {
input.style.textAlign = 'left';
});

});


Just replace the whole thing with the code


Forum|alt.badge.img+1
  • Author
  • 3 replies
  • October 4, 2024

I WISH I COULD GIVE YOU A BIG HUG

😘


MichaelC
Administrator
Forum|alt.badge.img+40
  • Administrator
  • 704 replies
  • October 7, 2024

I WISH I COULD GIVE YOU A BIG HUG

😘

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