Arranging Values Shown to Respondent from Slider | XM Community
Solved

Arranging Values Shown to Respondent from Slider


Userlevel 2
Badge +1
On a survey, we're using a slider as a way for the respondent to allocate money between two hypothetical subjects on either end of the slider.

I know that in a general question, we can allow the slider to "Show Values" to the respondent so they see what answer they're choosing on it. Because our particular question is an allocation between two subjects, what we'd like is to have that same information displayed, but below the slider and from the perspective of both ends of the slider (so if our slider goes from 0 to 50, and the respondent has dragged the handle on the slider to 37, we'd like the boxes below the slider to show "37" on the left side, and "13" on the right side (50-37, which is what the respondent has allocated to the subject on the other end of the slider by dragging)).

I'm assuming that I just want to get the same snippet of code that Qualtrics uses to show the value above the slider that we could see in a regular setting, but just place that value on a different location of the page, and then another box subtracting that same value from whatever the maximum value on the slider is, but I'm basically completely new to CSS and Javascript so I can't get it to work even by Inspecting the page with Chrome to see what the Page Source and CSS sheets look like. Appreciate any help!
icon

Best answer by DRRTGCC 17 June 2018, 02:18

View original

3 replies

Userlevel 2
Badge +1
I've managed to figure this out. For some reason, I can't post Javascript code on here without Qualtrics freaking out and giving me a message about "Access Denied", so I'll point you to the StackOverflow question I also asked, where I detailed the solution:

https://stackoverflow.com/questions/50768528/performing-a-simple-math-operation-in-real-time-with-runtime-data-in-qualtrics/50892615#50892615

Hope this works for somebody else!
Userlevel 6
Badge +7
Hi @DRRTGCC! We're sorry you're getting an error - that shouldn't be the case! You'll want to be sure that you are indicating that the Javascript you are sharing is code by formatting it as code in the Community. The below image shows you where to do that. If you still are getting an error after adding the code formatting, feel free to direct message me and we'll get to the bottom of this!
!
Userlevel 2
Badge +1
Hi Emily, thanks your response! I kept getting an error message even after code formatting, for some reason. Formatting worked okay for a bit of CSS/ HTML code I included in the answer, but not the Javascript.

Leave a Reply