Changing text strings with slider

Hello Everyone,
I’m just playing around with Sparkle 5 and try to explore the slider function. How can I display for example the changing text strings “very easy”, “simple”, “normal”, “difficult”, “impossible” next to the slider element when I move the slider?

Thanks for any help.

HI Franky, I assume, that you want to move something on your webpage with a slider?
I am not sure, if that is possible…
I am under the impression, that the slider is a form variable, that also can be used in Smart Fields…
Maybe in Hype4?

Hi Tom,
Sorry, if I wrote not clearly. I just wanna chance some text strings with the slider element. The slider function works great with numbers and increments. Now I’m wondering if it works with text too.

Do you have an example for what is working and what you want to achieve?

Just a sample: One single slider with 5 steps. The text changes with each step.

Apparently the slider can only display numeric values and no text.

1 Like

With a tiny bit of javascript knowledge it is possible to make the calculator return a string.

Say setting a slider with a 1-5 range, then:

if(<slider>==1) { return "very easy"; }
if(<slider>==2) { return "simple"; }
if(<slider>==3) { return "normal"; }
if(<slider>==4) { return "difficult"; }
if(<slider>==5) { return "impossible"; }

(untested, replace the <slider> thing with the bubble that the calculator lets you plop in)


Many thanks for this sample. It really helps to go deeper into the function. Javascript opens endless of possibilities here. Even as a non-coder it would be helpful to learn some basics of javascript. I’ll keep on with that.

Thanks again, Frank