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?
Asked
Active
Viewed 181 times
0
-
That's too broad. Please provide something more (code). – Gynteniuxas Sep 14 '16 at 18:28
1 Answers
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