This is related to my question which i asked in this link How do i get Min and Max value of Bootstrap slider?
I was not able to get answer for this particular question in that discussion, thats why i planed to ask it as new question.
What i need is to get current min and max value from bootstrap slider control in my javascript.
This is how my control looks like
<input id="rbSlider" type="text" class="span2" value="" data-slider-min="0" data-slider-max="1000" data-slider-step="5" data-slider-value="[0,1000]" />
And in my button click i tried to get its min ans max value using following
var min = $('#rbSlider').data('slider-min');
var max = $('#rbSlider').data('slider-max');
But it always returns Min as 0 and Max as 1000 even its set as Min 2 and Max 10.
How do i get 2 and 10 in my javascript?
For sure you can do this that way:
var min = $('#rbSlider').data('slider').options.min;
var max = $('#rbSlider').data('slider').options.max;
UPDATE
Probably you need:
var min = $('#crSlider').data('slider').options.value[0];
var max = $('#crSlider').data('slider').options.value[1];
In general if you want to access widget data which is created using Widget Factory (https://learn.jquery.com/jquery-ui/widget-factory/how-to-use-the-widget-factory/) you can do this using this pattern:
var widget = $(selector).data(widget_name);
So if you initialize widget like for example:
$('#ex1').datepicker();
You can access widget data by:
var datepicker = $('#ex1').data('datepicker');
And usually widget params are in 'options' property.
Use some Firebug or other web dev tool and play with that you could see what you can access and how.
Regards Piotr