lundi 7 mars 2016

How should I pass the value of price slider to the controller using ajax

Here is my code,

var $range = $("#price-slider");
$range.ionRangeSlider({
    min: 130,
    max: 575,
    type: 'double',
    prefix: "$",
    prettify: false,
    hasGrid: true,
    onChange : function (data) {
        console.log(data);
    }
});

Here, it would like to pass the value to the controller. How should I use Ajax inside the onChange function

And my Ajax is something like this

$.ajax({
  url: 'hotelresults',
  type: 'POST',
  data: {
    from: from_val,
    to: to_val
  },
  success: function(data) {
    $('.hotel_list').html(data);
  }
});

And also here,I dont know how to get the from and to value of price slider..

Someone help me..

Regards Suganya



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire