Marc Rasmussen
Marc Rasmussen

Reputation: 20545

bootstrap slider always returns "10"

i have the following slider:

<input id="sliderInput" class="slider slider-horizontal form-control" type="text" value=""
   data-slider-min="5" data-slider-max="20" data-slider-step="1"
   data-slider-value="10" data-slider-orientation="horizontal">

And combined the following javascript:

$('#sliderInput').slider()
$('#tester').click(function()
{
    alert($('#sliderInput').data.getValue());
})

However no matter what i do the value returned is always 10.

I read the following question:

How to get value of bootstrap-slider

However this didn't do anything for me :S

It seems it might be broken but can anyone tell me if it is possible to get the correct value? (maybe a hack?)

Upvotes: 0

Views: 78

Answers (1)

elzi
elzi

Reputation: 5672

IIRC that method is broken.

Try:

$('#sliderInput').data('slider').getValue()

Upvotes: 1

Related Questions