side by side text boxes for one question? | XM Community
Solved

side by side text boxes for one question?

  • 28 January 2021
  • 2 replies
  • 81 views

How can I have two side by side text boxes for one question with texts in between, e.g., (_____ out of ____ )? Thanks in advance!

icon

Best answer by ahmedA 31 January 2021, 21:28

View original

2 replies

Userlevel 7
Badge +21

This isn't possible using the default Qualtrics settings. However, you can use elements in the question in HTML and then store their value using embedded data. This is the demo for the code below:
Question HTML:
Please enter your value


Out of

Question JS:
Qualtrics.SurveyEngine.addOnPageSubmit(function(){
var my_val = this.getQuestionContainer().querySelector("#my_val").value;
var max_val = this.getQuestionContainer().querySelector("#max_val").value;

Qualtrics.SurveyEngine.setEmbeddedData("my_val", my_val);
Qualtrics.SurveyEngine.setEmbeddedData("max_val", max_val);
});

Thank you ahmedA ! Your solution perfectly solved this problem!

Leave a Reply