Indenting slider question | XM Community
Solved

Indenting slider question

  • 15 April 2024
  • 2 replies
  • 11 views

Badge +1

I am building a survey with multiple slider questions on a page. There are instructions at the top of the page which apply to the whole page, and I want to make it clear that the slider questions are nested under the text paragraph at the beginning. To do so, I want to indent each question 45px. I found this javascript code in a previous discussion, but it doesn’t work for me: 

Qualtrics.SurveyEngine.addOnload(function()
{
    jQuery("#"+this.questionId).find('.QuestionBody:first').css("margin-left", "45px");

});

I also am able to indent the text of each question with HTML, but it doesn’t indent the question itself. For an example of what I am looking for, see the outline below:

Task description and explanation. This is a paragraph that is a few sentences long. This should be the only text hitting the left side of the page, and everything else indented. 

     Q1 Question 1 text 

     slider question 1 2 3 4 5 6 7 

     Q2 Question 2 text 

     slider question 1 2 3 4 5 6 7 

     Q3 Question 3 text 

     slider question 1 2 3 4 5 6 7 

icon

Best answer by ahmedA 15 April 2024, 18:29

View original

2 replies

Userlevel 7
Badge +21

Update your JS to indent all: 

jQuery('.QuestionBody').css("margin-left", "45px");

 

Badge +1

@ahmedA Thank you! This worked. For others who may be looking at this post, I was using the new “Simple” theme and it was causing this javascript formatting not to work, but once I switched back to an older theme it worked like a charm!

Leave a Reply