[Solved] Repost/ asking again. Change event in Kartik’s bootstrap-slider extension for Yii2


You should always keep your console or developer bar open when working with javascript, you never know when something conflicts with the other.

You need to use parseInt() to pass a value to the setValue function of the slider, it is interpreting it as text, otherwise, it throws

Uncaught Error: Invalid input value ‘1’ passed in

if you are getting the same error as above in your console when you type in the text box, then you need to change the code to the following

$this->registerJs(
    "$('#test').on('input',function(){
        $('#w17-slider').slider('setValue',parseInt($(this).val()));
    })",
    \yii\web\view::POS_READY);

8

solved Repost/ asking again. Change event in Kartik’s bootstrap-slider extension for Yii2