Answer the question
In order to leave comments, you need to log in
Yii2 Form ActiveForm. How to transform the phone input field?
There is here such form:
It is necessary for me that at a mouse click there was a transformation of such type. That is, a phone number template was displayed:
I would be very grateful for your help.
Answer the question
In order to leave comments, you need to log in
print $form->field($model, 'phone')->label(false)->widget(\yii\widgets\MaskedInput::className(), [
'mask' => '+7 (999) 999 99 99',
])->textInput(['placeholder' => $model->getAttributeLabel('phone')]);
// ну или коротко..
print $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), [
'mask' => '+7 (999) 999 99 99',
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question