Ionrangeslider update value with previously set value

Shashank Bhatt picture Shashank Bhatt · Aug 23, 2017 · Viewed 9k times · Source

I am using ionRangeslider in one of my forms to show the range of tips.

How can I update the value on submit button click so that when next time page loads, it shows the slider with that particular updated value?

HTML code

<input type="text" class="exampleslider" id="exampleslider" name="tips">

And Calling to ionRangeSlider via js

$('.exampleslider').ionRangeSlider({
  from: 0,
  to: 100,
  min: 0,
  grid: true,
  grid_num: 10,
  step: 10,
  postfix: '%',
});

Input is given name tips through which I want to set its value via database.

Answer

sajad khajeh picture sajad khajeh · Feb 14, 2018
 var instance = $(id).data("ionRangeSlider");

 instance.update({
   from: 10 //your new value
 });