Move text entry to the left of response option in multiple choice question | XM Community
Skip to main content
Solved

Move text entry to the left of response option in multiple choice question


Forum|alt.badge.img+1

Hi all,

Could anyone provide java script to move the text entry box to the left (and in-line) with my response options in a two choice multiple choice question

Thanks in advance!

Best answer by Deepak

Hello @2024EmmaSteelatUC 

Try below code:

Qualtrics.SurveyEngine.addOnReady(function()
{
	/*Place your JavaScript here to run when the page is fully displayed*/
var QID = this.questionId;
	jQuery("#"+this.questionId+" .InputText").each(function(){
		var QIDOtherLabel = jQuery("#" + QID).find(this).siblings().attr("id");
		jQuery("[id='" +QIDOtherLabel+"']").find('span').before(jQuery("#" + QID).find(this));
		jQuery("[id='" +QIDOtherLabel+"']").css("padding-top","30px");
		jQuery("[id='" +QIDOtherLabel+"']").css("padding-bottom","30px");

	});
	jQuery("#" + QID).find(".TextEntryBox").css("float","unset");
});

Hope it helps!

View original

2 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+44
  • 1549 replies
  • Answer
  • March 4, 2024

Hello @2024EmmaSteelatUC 

Try below code:

Qualtrics.SurveyEngine.addOnReady(function()
{
	/*Place your JavaScript here to run when the page is fully displayed*/
var QID = this.questionId;
	jQuery("#"+this.questionId+" .InputText").each(function(){
		var QIDOtherLabel = jQuery("#" + QID).find(this).siblings().attr("id");
		jQuery("[id='" +QIDOtherLabel+"']").find('span').before(jQuery("#" + QID).find(this));
		jQuery("[id='" +QIDOtherLabel+"']").css("padding-top","30px");
		jQuery("[id='" +QIDOtherLabel+"']").css("padding-bottom","30px");

	});
	jQuery("#" + QID).find(".TextEntryBox").css("float","unset");
});

Hope it helps!


Forum|alt.badge.img+1

Thanks Deepak, yes it worked!


Leave a Reply