two handle sliders - Java Script | XM Community
Question

two handle sliders - Java Script

  • 17 March 2019
  • 9 replies
  • 411 views

Hi,

I am trying to put together a survey where I ask for a range using a slider with two handles. then record the high and low number for that question

Being new to Java Script i tried to use the code from a previous thread which suggested this web page

https://codepen.io/Op_Je_Plaatsman/pen/VdKEam

So far I have tried to use it in a question but can't get it to display in the question.

Wondering how to get it to read results and to display in the question.

Currently the code looks like this:

Qualtrics.SurveyEngine.addOnready(function()
{
jquery("#slider-range").slider({
range: true,
min: 0,
max: 10,
step: 1,
slide: function( event, ui ) {
$( "#min-value").html(ui.values[ 0 ]);

suffix = '';
if (ui.values[ 1 ] == $( "#max-price").data('max') ){
suffix = ' +';
}
jquery( "#max-value").html(ui.values[ 1 ] + suffix);
}
})


});

9 replies

Hello @Bri ,

You can use Slider question with two statements.
> @Shashi said:
> Hello @Bri ,
>
> You can use Slider question with two statements.

Shashi,

Trying to get the participant to show a high and low range for an answer. They'll be two questions with these sliders for each image shown and two different sliders for high and low will get too much to do over various images through the survey
Userlevel 5
Badge +6
Hi @Bri,
I was able to display this one in Qualtrics just by copying the HTML part of the code into the question.
@Bri did you ever figure this out? I'm facing the same issue. --the other bri

Did anyone figure this out?

Userlevel 7
Badge +27

You can use noUiSlider and write some JavaScript to capture the data in Qualtrics.

Thanks TomG!

I was actually looking at something like this. I am quite new to this, but need the range/two handles per slider to prevent overconfidence and wishful thinking of the respondents. In the end, I want to have 7 two-handle sliders per question.. you think this is possible?

Userlevel 7
Badge +27

Jaro1234 - Yes, it is possible for someone with strong JavaScript skills.

then for me it is impossible, I will try and see if I can outsource this :)

Leave a Reply