Cmaskedinput Default Value

Hey everyone! I’m using beautiful CMaskedInput and I wonder if there is a way to set my text field a default value. I’m using +7(999)999-99-99 mask, and one solution is to use a placeholder instead of input’s ‘value’ attribute, but to my mind it’s not the best option. Any ideas?

Thx, Max.

hey I am not sure if this what you looking you can setup a default value of your attribute in your controller.

in your controller/action you have something like


$model = new ModelName;

$model->Fieldname = "value";

Note:

  1. use this if you need a new default value each time you initialize your model

  2. alternatively you can setup in model.