nickcharlton
nickcharlton

Reputation: 856

How to Get Values from jQuery Select Slider?

I'm using the Filament Group's jQuery Select Slider to produce a form for selecting a range of specific values.

How can I get the values of the slider and update <input> field?

$(function(){
    $('select').selectToUISlider({
        labels: 7
    });
    //fix color 
    fixToolTipColor();
});

I understand that I can get the values through the jQuery UI Slider through a change function. How would I do that?

Upvotes: 1

Views: 2801

Answers (1)

SolutionYogi
SolutionYogi

Reputation: 32233

The plugin already updates the 'select' element for which you have created UI Slider.

If you want to update another 'input' element, why not hook up the change event for your select and use it to update your input field.

$(function(){

    $('select')
        .selectToUISlider({ labels: 7 })
        .change(
                function()
                {
                    $('#myInputField').val(this.val());
                }
               );

        //fix color 
        fixToolTipColor();
});

Upvotes: 4

Related Questions