how can i update slider’s position if slider’s value differs from value from a textbox ?
$("#slider").slider({
max: 30000,
min: 1000,
step: 1000,
range: true,
animate: true,
values: [1000, 15000],
slide: function(even, ui)
{
$("#edit-field-price-value-min").val(ui.values[0]);
$("#edit-field-price-value-max").val(ui.values[1]);
}
});
as you can see i am changing with the slider the values on some textbox but i want it vice versa also
i’d like to be using a if statement so that at any moment if the values from text box would change the slider would as well
is it possible to do it onload maybe ?
<div id="slider"></div>
You’re going to want to set an event during $(document).ready() to your two text fields. Depending on the behavior, you could use the change() event or blur() event:
So when your textfield is changed, it will update the slider.