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

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

  • Mar 3, 2024 11:10 PM UTC
  • 2 replies
  • 213 views

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+48
  • Answer
  • Mar 4, 2024 5:48 AM UTC

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!