Page 1 of 1

Getting current slider value

Posted: Wed May 01, 2013 12:45 pm
by dale

Hi,

I'm trying to get a slider's current value.

I've tried ...

var a=Tiggzi('distance_slider').val();
console.log(a);

as I've seen in another thread, but value is undefined.

When looking at source, and moving the slider I see that aria-valuenow changes inline with the UI element.

Is Tiggzi('distance_slider').val(); still valid?

Thanks,

Dale.


Getting current slider value

Posted: Wed May 01, 2013 1:38 pm
by maxkatz

You need to get value from this element:
code
<input type="number" data-type="range" name="slider" dsid="slider" id="j_6" data-theme="b" data-track-theme="b" value="65" min="0" max="100" tabindex="3" class="mobileslider1 ui-input-text ui-body-b ui-corner-all ui-shadow-inset ui-slider-input ui-focus" data-mini="false">
/code


Getting current slider value

Posted: Wed May 01, 2013 2:12 pm
by dale

Thanks.

This is my element:

Doesn't work - the name is distance_slider

and I'm using ...
var a=Tiggzi('distance_slider').val();

Dale.


Getting current slider value

Posted: Wed May 01, 2013 3:15 pm
by maxkatz

Getting current slider value

Posted: Wed May 01, 2013 3:43 pm
by dale

Thanks.

I have even renamed my slider to "slider" - still no joy! ;-)

I run the js on a data mapping 'edit js' on a places service to pull in the value and run the request.

I've done this with other controls and works ok.

Ta.

Dale.


Getting current slider value

Posted: Wed May 01, 2013 5:12 pm
by maxkatz

The element that you select, print it to console -- to make sure you get the right element.