0

Hope this is not a duplicate because i didn't find question like this.

I'm using jQRangeSlider for date range. The slider works showing min and max date and changing as i move it. I want to pull the date and save it into MySQL database. I need the dates like this:

<input type="text" name="min" />
<input type="text" name="max" />

So far i didn't have any luck in making it work.

I have this:

<script>

$("#slider").dateRangeSlider();

 </script>

and this:

// Date slider
var dateValues = $("#dateSlider").dateRangeSlider("values");
console.log(dateValues.min.toString() + " " + dateValues.max.toString());

any help is appreciated

1 Answers1

0

You'll need an event handler that triggers when the slider changes

$("#slider").on("valuesChanging", function(e, data){
  console.log("from: " + data.values.min + ", to: " + data.values.max);
});

FIDDLE

adeneo
  • 312,895
  • 29
  • 395
  • 388
  • I'd suggest using valuesChanged instead of valuesChanging because it's triggered only once the change is done. – ghusse Mar 21 '14 at 13:35