Place the question of a dropdown style question to the left of the dropdown | XM Community
Skip to main content
Solved

Place the question of a dropdown style question to the left of the dropdown

  • May 2, 2023
  • 3 replies
  • 88 views

Forum|alt.badge.img+2

Hi, I am looking to customize the display of a dropdown question. In the default setting, the question appears above the dropdown. I tried adding the following javascript code to place the question text to the left of the dropdown:
 

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var id=this.questionId;

jQuery("#"+id).find("Select").before("This is the question text? ");


});

However the dropdown menu is still displayed below the question. Looking for pointers on how to place the question text to the left of the dropdown. Thanks a lot!

Best answer by Shashi

For single select drop down question, we can use below JS:

	jQuery("#"+this.questionId+" .QuestionText").insertBefore("#"+this.questionId+" .ChoiceStructure").css("display","inline-block");

 

3 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • May 2, 2023

Another easy approach would be to use Matrix question with drop down list wherein we can simply put question text in the statement and hide the question text using below JS:

jQuery("#"+this.questionId+" .QuestionText").hide();

 


Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • Answer
  • May 2, 2023

For single select drop down question, we can use below JS:

	jQuery("#"+this.questionId+" .QuestionText").insertBefore("#"+this.questionId+" .ChoiceStructure").css("display","inline-block");

 


Forum|alt.badge.img+2
  • Author
  • Level 2 ●●
  • May 2, 2023

For single select drop down question, we can use below JS:

	jQuery("#"+this.questionId+" .QuestionText").insertBefore("#"+this.questionId+" .ChoiceStructure").css("display","inline-block");

 

This still doesn't seem to work :( Could you elaborate on the solution bit more please?