Slider ID | XM Community
Skip to main content
Hello, how can I find the slider ID of a slider question? I tried with inspect, but I could not find it... Many thanks!
Hi!!



you can try going to account settings -> Qualtrics Ids and there you can select from the list the desired survey and in the new window you will find the IDs for each survey



!
Hi @ana_velez_voce,



Thanks a lot for your help - I am afraid, I do not need the Questions ID, but the ID of the very slider used in the question...
@Elitza_17,



A slider is made up of several elements with different ids. The ids roughly follow the format QIDx~y~z where x is the question, y is the choice and z is the component. You'd have to be more specific about what your purpose is or what component you are looking for.
Hi @TomG,



Thank you very much for your help. I got to something like this via Inspect - i need to get to the handle as a component - I want to send an event, i.e. as if someone has clicked on the handle so that it displays the value of the Custom Slide Position of the slider... it does show it the moment you touch the slider, but I need it displayed when you open the page... I tried



var s = jQuery("#"+this.questionId);

s.find("QID13~1~handle).trigger("mouseover");



but it doesn't work... any help with what I have got wrong would be greatly appreciated!
> @Elitza_17 said:

> Hi @TomG,

>

> Thank you very much for your help. I got to something like this via Inspect - i need to get to the handle as a component - I want to send an event, i.e. as if someone has clicked on the handle so that it displays the value of the Custom Slide Position of the slider... it does show it the moment you touch the slider, but I need it displayed when you open the page... I tried

>

> var s = jQuery("#"+this.questionId);

> s.find("QID13~1~handle).trigger("mouseover");

>

> but it doesn't work... any help with what I have got wrong would be greatly appreciated!



Three things:

1. You are missing a quote at the end of the id

2. In jQuery id selectors need to be preceded by #

3. Technically, tildes (~) aren't supposed to be used in ids, so they need to be double escaped.

```

s.find("#QID13\\\\~1\\\\~handle").trigger("mouseover");

```
Hi @TomG,



Thank you very much for your kind help! I have just tried with the code you've sent and unfortunately it still doesn't display the Custom Start Position... could be that one can't display the value like this or maybe this component is not called "handle", I also tried toolTipBox but it did not work - how do you see the name of each component of the slider?

In any case, thanks a lot for pointing out all the mistakes and sending over the correct code - much appreciated!
> @Elitza_17 said:

> Hi @TomG,

>

> Thank you very much for your kind help! I have just tried with the code you've sent and unfortunately it still doesn't display the Custom Start Position... could be that one can't display the value like this or maybe this component is not called "handle", I also tried toolTipBox but it did not work - how do you see the name of each component of the slider?

> In any case, thanks a lot for pointing out all the mistakes and sending over the correct code - much appreciated!

Are you trying to get the numeric start value to show without clicking the handle (answering)?
Hi @TomG,



yes, precisely - I have been trying different ways, but nothing worked so far...
> @Elitza_17 said:

> Hi @TomG,

>

> yes, precisely - I have been trying different ways, but nothing worked so far...

That's really tricky because the value isn't in the html until the handle is clicked. Dividing the left margin of the handle by the width of the slider would get you close, but there is an adjustment for the width of the handle. You would have to reverse engineer that calculation to get an accurate value.
Thank you so much @TomG – that sounds amazing and explains why I could not find the value with Inspect… these calculations are probably well beyond my ability but I will give it a try - do you have any advice on where I could read more about that type of calculation? Thanks a lot again for all your help!
> @Elitza_17 said:

> Thank you so much @TomG – that sounds amazing and explains why I could not find the value with Inspect… these calculations are probably well beyond my ability but I will give it a try - do you have any advice on where I could read more about that type of calculation? Thanks a lot again for all your help!



I think this formula gets you very close:

percent = leftHandlePx / (widthSliderPx - widthHandlePx)



Then convert to whatever the scale of your slider is (e.g., multiply by 100 if slider is 0 to 100)
Brilliant! Thank you so much for your amazing help, @TomG !

Leave a Reply