Maskedinput With Activeform

Hello,

how can I use the MaskedInput widget in a active form?

MaskedInput::classname([

  'name' => 'phone',


  'mask' => '999-999-9999',

])

Thanks,

Florian

See http://stuff.cebe.cc/yii2docs/yii-widgets-activefield.html#widget()-detail

You can use it like the following:




 $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), [

          'mask' => '999-999-9999',

     ]);



Thanx CeBe :slight_smile: