mask input client validation

An attribute in my model has rule:


[['noic'], 'string', 'max' => 12, 'min' => 12],

the attribute is bound to a masked input in active form:




$form->field($model, 'noic')->widget(MaskedInput::classname(), [

        'id' => 'noic',

        'name' => 'noic',        

        'mask' => '999999-99-9999'

    ])



The user input value at front end will be in format 999999-99-9999, but what i want to accept at the back is in format 999999999999.

So obviously the input value will has length of 14, bigger than rule in model which is 12.

On server side i can do this to make validation correct




$modelPemohon->noic = str_replace('_', '', $modelPemohon->noic);

$modelPemohon->noic = str_replace('-', '', $modelPemohon->noic);



Problem now is the client side validation will give error indicate that the field should contain at most 12 characters.

How to fix this?