N
N
Nikolai Novosad2015-12-27 17:50:42
Yii
Nikolai Novosad, 2015-12-27 17:50:42

Yii2 Get value of SliderInput?

Hello.
To display the price range I use SliderInput.
Installed and displayed in the view without problems. But here it would be desirable, that in 2 input values ​​of each slider were shown. As I understand from the documentation, you need to use the Protected Properties $clientEventMap slide. I just can't figure out how to implement it.
Let's say I have input1 and input2.
Here is the range:

<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>

<?= $form->field($model, 'name')->widget(\yii\jui\SliderInput::classname(), [
    'clientOptions' => [
        'min' => 1,
        'max' => 10,
        'values' => [0,100],
    ],
]) ?>

<?php ActiveForm::end(); ?>

And how to register so that the value of the left slider flies to input1, and the right slider to input2?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LAV45, 2015-12-27
@LAV45

I just can't figure out how to implement it.

$clientEventMap is the same public parameter as $clientOptions
respectively and is configured as in your "clientOptions" example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question