Answer the question
In order to leave comments, you need to log in
How to save data and work with it on bootstrap-slider?
Hello.
--
There is a bootstrap-slider.js script that makes an interesting type=range out of the input.
I like it externally, but turned out to be capricious when I applied it to a Yii2 search.
Like any other input, there is a value that passes data:
<input id="ex1" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="14"/>
<?=$form->field($model, 'word')->textInput(['value' => $model->word]);?>
<?=$form->field($model, 'word')->textInput(['value' => $get['ClassSearch']['word']]);?>
<?=$form->field($model, 'word')->textInput(['data-slider-value' => $get['ClassSearch']['word']]);?>
...
<?=$form->field($model, 'word')->textInput(['data-slider-value' => $model->word]);?>
Answer the question
In order to leave comments, you need to log in
When submitting the form, you will not be passed any data-parameters, as well as id, classes, inline styles and other attributes of the input. Only name and value. All.
You will have to write your own processing: when changing in value, you can enter JSON with the left and right values.
You can look for ready-made solutions, perhaps the standard plugin www.yiiframework.com/doc-2.0/yii-jui-sliderinput.html can
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question