Is there a way to create a click up/down question? | XM Community
Skip to main content
Solved

Is there a way to create a click up/down question?


Hi!
I am creating a survey in which one of the questions asks the respondents for their age. However, I specifically want to ask the question with a "click up/down" design as can be seen on the picture below. The closest I could get is by using the drill-down question type but I wonder if there is a way to create a design that looks exactly like on the picture below.
Thank you for your help.
Best,
Erika
image001 (1).png

Best answer by ElieD

You will need custom javascript, so
Add this code to your question :
Qualtrics.SurveyEngine.addOnload(function()
{
var q = document.getElementById("QR~"+this.questionId);
q.type = 'number';
q.min = 0;
q.max = 100;
});
you can ajust min and max as you wish

View original

12 replies

ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • February 18, 2021

Hi Erika,
Maybe you could use a slider between 0 and 100 instead ?


  • Author
  • 8 replies
  • February 18, 2021

ElieD
Thank you for your answer! It is a good advice and I have considered it but I thought that maybe there is a way to create an up/down option on Qualtrics. If not, then I will stick to either the slider or the drill-down :)


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • Answer
  • February 18, 2021

You will need custom javascript, so
Add this code to your question :
Qualtrics.SurveyEngine.addOnload(function()
{
var q = document.getElementById("QR~"+this.questionId);
q.type = 'number';
q.min = 0;
q.max = 100;
});
you can ajust min and max as you wish


  • Author
  • 8 replies
  • February 18, 2021

ElieD
Thank you very much! I will try it out! Do I need to change something else in the code or do something else? I do not know much about coding unfortunately...


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • February 18, 2021

Just add javascript to your question, and add this code in place of :
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
});
And then enjoy 😊


  • Author
  • 8 replies
  • February 18, 2021

ElieD
Great! Thanks a lot, I will try it ☺️


  • Author
  • 8 replies
  • February 22, 2021

ElieD
Thank you once again for the help, I have been trying to make the code work but have not really managed. Am I doing something wrong? Please see the picture attached 😊
image.png


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • February 22, 2021

EconIka
you don't have to include the questionId, the code will do it itself.
Just replace ("QR~QID1~5") with

("QR~"+this.questionId)


  • Author
  • 8 replies
  • February 22, 2021

ElieD
I tried that as well but it does not seem to work for some reason...😕
image.png


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • February 22, 2021

Do you have the same thing as this :
image.pngand your question is of type "Text entry" ?


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+39
  • QPN Level 4 ●●●●
  • 123 replies
  • February 22, 2021

Here is what I get :
image.png


  • Author
  • 8 replies
  • February 22, 2021

ElieD
Oh, now I know what was wrong! I did not have the question type "Text Entry" but still had the "Drill down" one. Now it works perfectly! Thank you very much for helping me with this!😊


Leave a Reply