H
H
HellWalk2018-02-14 15:47:13
Yii
HellWalk, 2018-02-14 15:47:13

\yii\widgets\MaskedInput does not work, what could be the reason?

You need to add a phone validation mask to the field, I add it in the usual Yii2 design - everything works:

<?= $form->field($model, 'subject')->widget(\yii\widgets\MaskedInput::className(), [
                    'mask' => '999-999-9999',
                ]) ?>

A6ooXZw0Oq.png
I do the same on the working design - it doesn't work:
<?= $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), [
                    'mask' => '999-999-9999',
                ]) ?>

R5mN1LH35D.png
There are no errors in the console though.
I checked the loading of js files, everything is also loaded on the working design:
/assets/26c728d5/jquery.js (+)
/assets/4ba5c71d/yii.js (+)
/assets/4ba5c71d/yii.validation.js (+)
/assets /ccdf817b/jquery.inputmask.bundle.js (+)
/assets/4ba5c71d/yii.activeForm.js (+)
/assets/2ab111e0/js/bootstrap.js (+)
What could be the reason?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question