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

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

  • 18 February 2021
  • 12 replies
  • 15 views

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

icon

Best answer by ElieD 18 February 2021, 14:52

View original

12 replies

Userlevel 6
Badge +37

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

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 🙂

Userlevel 6
Badge +37

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

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...

Userlevel 6
Badge +37

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 😊

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

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

Userlevel 6
Badge +37

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

("QR~"+this.questionId)

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

Userlevel 6
Badge +37

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

Userlevel 6
Badge +37

Here is what I get :
image.png

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