views:

315

answers:

0

I am referring to

http://www.filamentgroup.com/lab/update_jquery_ui_slider_from_a_select_element_now_with_aria_support

and having hard time retrieving the selected value on the slider. Initially I was having a dropdown which had an onchange event associated with it.. and worked like a charm by calling

 <select id="myselect" onchange="myfunction(this);" >

but now requirement changed to a slider

 $('select#myselect').selectToUISlider({sliderOptions: {stop: function(e,ui) {alert(this.val());}}});

it throws me this.val() is not a function.

I also tried to use

$('select#myselect').selectToUISlider({sliderOptions: {stop: function(e,ui) {alert(ui);}}});

but using the ui argument also I could not retrieve the selected value... it just returns me the selected index.

the dropdown looks lke this

<select name="myselect" id="myselect">
            <option value="20">txt1</option>
            <option value="30">txt2</option>
            <option value="40" selected="selected">txt3</option>
            <option value="50">txt4</option>
            <option value="60">txt5</option>
        </select>

It would be excellent if I could just be able to trigger the onchange event of the select box but looks like when using the slider, the value of the dropdown changes but it does not trigger the event.

Any help is really appreciated!

Thanks