Indenting slider question | XM Community
Skip to main content

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 

Update your JS to indent all: 

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

 


@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