I have a combo "Type Person" with the options (1 - Physics | 2 - Legal) and I need to limit the size of standard characters to fill in the text field "CPF / CNPJ".
In fact, I need to validate the text field for when selecting the combo type person "1 - Physics" the maxlength will be in the standard for the CPF, and thus for the same to the CNPJ.
The Form
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-2">
<div class="form-group">
<label for="tipoPessoa">Tipo Pessoa:*</label>
<select
id="tipoPessoa"
name="tipoPessoa"
data-ng-required="true"
data-ng-model="vm.tipoPessoa"
class="form-control input-sm"
data-ng-options="opt as opt.tipoPessoa for opt in options">
</select>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3">
<div class="form-group">
<label for="cpfcnpj">CPF/CNPJ:*</label>
<input type="text"
id="cpfcnpj"
name="cpfcnpj"
data-ng-required="true"
data-ng-model="vm.simulacao.cpfcnpj"
required="required"
class="form-control input-sm" />
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3">
<button type="button" class="btn btn-sm btn-primary"
data-ng-click="vm.limparSelecionados(); vm.pesquisar();"
data-ng-disabled="Form.$invalid" style="margin-top: 22px;"
data-aria-label="Right Align">
<i class="glyphicon glyphicon-search"></i> <span>Pesquisar</span>
</button>
</div>