1
I have the following modal:
<div class="modal fade" id="anti_fraude_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Digite seu CPF</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<input type="text" class="form-control cpf_antifraude masked-input" id="anti_fraude_cpf" name="anti_fraude_cpf">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary" id="anti_frade_continuar">Continuar...</button>
</div>
</div>
</div>
</div>
And I need to apply the mask in the CPF field. I tried it as follows:
$("#anti_fraude_modal").modal('show');
var $MaskedInput = $('.masked-input');
$MaskedInput.find('.cpf_antifraude').inputmask('999.999.999-99', { placeholder: '___.___.___-__' });
But did not apply the mask, but also did not fail.
I started the mask when I load the main page normally.
Okay, that’s right, thank you! :)
– Sr. André Baill