0

I need to understand how to use MaskedInput definitions property because i have "phone" field and it have always contain + at start and after it it have contain 10-15 decimal characters. How to implement it?

Link
  • 669
  • 7
  • 20

1 Answers1

0

I've used something like this

<?= $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), [
                'mask' => '99-99999999-9',
            ]) ?>

See http://www.yiiframework.com/doc-2.0/yii-widgets-maskedinput.html and https://github.com/RobinHerbots/Inputmask

You could try

<?= $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), [
                'alias' => 'phone',
            ]) ?>
Nico Savini
  • 458
  • 3
  • 10