Closed trix1210 closed 2 years ago
You get the value from the input, then use it.
var inputMin = document.getElementById('inputMin');
var inputMax = document.getElementById('inputMax');
noUiSlider.create(priceSlider, { start: [0, 2000], connect: true, step: 50, margin: 150, range: { min: inputMin.value, max: inputMax.value, }, tooltips: true, format: wNumb({ decimals: 0, prefix: '£', }), });
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
how do i set the min and max slider ranges based on a form input instead of hardcoding min and max values in the .js code?
noUiSlider.create(priceSlider, { start: [0, 2000], connect: true, step: 50, margin: 150, range: { min: 0, max: 2000, }, tooltips: true, format: wNumb({ decimals: 0, prefix: '£', }), });