tags:

views:

24

answers:

1

Trying to set a select dropdown with a slider. You move the jquery ui slider and then it will change the selection of the other two dropdowns.

is there a current method in jquery that would set these options?

Current dropdown:

<select id="alert-options-frequency-opts">
                                            <option value=""></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                        </select>
+3  A: 

The slider has a slide event. Try hooking into that to set the value of the dropdown(s).

e.g

$("#slider").slider({
      value:0,
      min: 0,
      max: 10,
      step: 1,
      slide: function(event, ui) {
        $("#alert-options-frequency-opts").val(ui.value);
      }
    });

Here is a quick demo to get you started

redsquare
ah sorry with val(). didn't think that would actually work.
Chris J. Lee