Automatic character insertion in a form to validate CPF

Asked

Viewed 266 times

0

Friends, I am making a CRUD system and now I am working on consistencies, and in the part q the user type the CPF, I want that after typing 3 numbers, a point is inserted automatically, can anyone help? , thanks in advance

1 answer

0

Download this lib (http://www.geradorcpf.com/jquery.maskedinput-1.1.4.pack.js) and use as follows:

<script type="text/javascript" src="js/jquery.maskedinput-1.1.4.pack.js"/></script>

<input type="text" name="cpf" id="cpf" />

<script type="text/javascript">
    jQuery(document).ready(function($){ 
        $("#cpf").mask("999.999.999-99");
    });
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.