Text Entry Box Next to Question | XM Community
Skip to main content

Is there a way to move the text entry next to a question?

 

I did not come up with this, but @MohammedAli_Rajapkar --it looks like you answered a similar question in the past:

 

Add below code in JavaScript (OnReady Function)

var QID = this.questionId;
var QIDOtherLabel = jQuery("#" + QID).find(".TextEntryBox").siblings().attr("id");
jQuery("yid='" +QIDOtherLabel+"']").append(jQuery("#" + QID).find(".TextEntryBox"));
jQuery("yid='" +QIDOtherLabel+"']").css("padding-top","30px");
jQuery("yid='" +QIDOtherLabel+"']").css("padding-bottom","30px");
jQuery("#" + QID).find(".TextEntryBox").css("float","none");


That’s the code I used for the response categories on a multiple choice question for “other, please specify.” It does not work for a text-entry question!


Alternatively, we can also use form field question type and hide the question text using below JS:

jQuery(“#”+this.questionId+” .QuestionText”).hide();

 


I’m getting the following error: 

 

Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL


I’m getting the following error: 

 

Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL

Are you able to show what you’ve got in the JavaScript box?


I’m getting the following error: 

 

Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL

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

Use above JS.


Did you put the JS in one of the sections? e.g. 

Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#"+this.questionId+" .QuestionText").hide();

});

 


Try this. Might not work, but give it a shot:

 

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/
        jQuery("inputetype=text]").attr('style','max-width: 60px !important');
        (jQuery(".QuestionText")).append(jQuery("inputntype=text]"));
});
 


Leave a Reply