From ef4fe133b6f18ead203343938994b95ff91ff58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fernando=20Mendes=20da=20Costa?= <98fernandocosta@gmail.com> Date: Tue, 9 May 2023 13:36:33 -0300 Subject: [PATCH] =?UTF-8?q?carrega=20macara=20do=20cpf=20quando=20a=20p?= =?UTF-8?q?=C3=A1gina=20=C3=A9=20carregada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evento/formulario/integrantes.blade.php | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/resources/views/evento/formulario/integrantes.blade.php b/resources/views/evento/formulario/integrantes.blade.php index 0233e37..c737354 100644 --- a/resources/views/evento/formulario/integrantes.blade.php +++ b/resources/views/evento/formulario/integrantes.blade.php @@ -43,7 +43,7 @@ <div class="form-row d-flex"> <label for="cpf_consulta">CPF:</label> - <input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();"> + <input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control"> </div> <div class="form-row d-flex" style="margin-top:10px"> @@ -135,26 +135,9 @@ <script> - function mask_cpf() { - $("#cpf_consulta").keydown(function(){ - try { - $("#cpf_consulta").unmask(); - } catch (e) {} - - $("#cpf_consulta").mask("999.999.999-99"); - - // ajustando foco - var elem = this; - setTimeout(function(){ - // mudo a posição do seletor - elem.selectionStart = elem.selectionEnd = 10000; - }, 0); - // reaplico o valor para mudar o foco - var currentValue = $(this).val(); - $(this).val(''); - $(this).val(currentValue); - }); - } + $(document).ready(function () { + $("#cpf_consulta").mask("999.999.999-99"); + }); function removerIntegrante(id) { $(`#integrante${id}`).remove() -- GitLab