JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<p>
<label for="amount">Price range:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-range"></div>
JavaScript
function callService(val1,sliderValue1){
alert(val1);
$.ajax({
type: "POST",
url: "searchrange.php",
data:
{
a: val1,
b: val2
},
success: function (option)
{
alert("voted");
}
});
}
$sliderValue="";
$sliderValue1="";
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
},
stop: function(event, ui) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
b = 0;
$sliderValue=ui.values[ 0 ];
$sliderValue1=ui.values[ 1 ];
console.log($sliderValue)
console.log($sliderValue1)
callService($sliderValue,sliderValue1);
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
});