I need to get a variable from the price range slider for my online store. I want to repeat the value in PHP. This is the code in the test.php file:
<script> var slidervalue = $('#output').val(); </script> <?php echo "<script>document.writeln(slidervalue);</script>"; ?>
And this is the code in the bootstrap-slider.js file:
$(function() { $("#pricelimit") .slider({}) .on('slide', function() { $('#output').html(this.value); }) .trigger('slide'); });
And this is the code of the slider itself:
<input id="pricelimit" type="text" class="span2" value="" data-slider-min="10" data-slider-max="200" data-slider-step="5" data-slider-value="[20,100]"/>
However, the page says 'undefined'. What is wrong here?
source share