Commit ef4fe133 authored by José Fernando Mendes da Costa's avatar José Fernando Mendes da Costa
Browse files

carrega macara do cpf quando a página é carregada

parent becabd1a
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<div class="form-row d-flex"> <div class="form-row d-flex">
<label for="cpf_consulta">CPF:</label> <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>
<div class="form-row d-flex" style="margin-top:10px"> <div class="form-row d-flex" style="margin-top:10px">
...@@ -135,26 +135,9 @@ ...@@ -135,26 +135,9 @@
<script> <script>
function mask_cpf() { $(document).ready(function () {
$("#cpf_consulta").keydown(function(){
try {
$("#cpf_consulta").unmask();
} catch (e) {}
$("#cpf_consulta").mask("999.999.999-99"); $("#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);
}); });
}
function removerIntegrante(id) { function removerIntegrante(id) {
$(`#integrante${id}`).remove() $(`#integrante${id}`).remove()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment