I want to take value from input field to make changes to the slider.
<div id="gobutton">
<div class="ui search input">
<input type="text" id="start">
<input type="text" id="maxend>
</div>
<div class="ui btn-container">
<div id="range-slider"></div>
<a class="item" href="">Go</a>
</div>
</div>
$(function() {
$("#slider-3").slider({
range: true,
min: 0,
max: 500,
values: [35, 200],
slide: function(event, ui) {
$("#price").val("$" + ui.values[0] + " - $" + ui.values[1]);
$('#gobutton a').prop('href', '?start=' + ui.values[0] + "&end=" + ui.values[1];
}
});
$("#price").val("$" + $("#slider-3").slider("values", 0) +
" - $" + $("#slider-3").slider("values", 1));
});
<title>jQuery UI Slider functionality</title>
<link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- HTML -->
<p>
<label for="price">Price range:</label>
<input type="text" id="price" style="border:0; color:#b9cd6d; font-weight:bold;">
</p>
<div id="slider-3"></div>
As in this the value only changes when I slide the slider. How can I change the value of slider by typing in the text field.
Also the link (#gobutton) should also work.
Source: http://tutorialspoint.com/jqueryui/jqueryui_slider.htm