Browse Source

giving cpf input mask

BuildTools 3 years ago
parent
commit
4430cf3d4e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      script.js

+ 1 - 1
script.js

@@ -32,7 +32,7 @@ const validarCpf = (cpf) => {
 function validacao() {
 
 
-    var cpf = document.getElementById("cpf").value
+    var cpf = document.getElementById("cpf").value.replace(/[^a-z0-9 ]/g, "")
     var validInputs = document.querySelectorAll(".required")
     var resultadoValidacao = validarCpf(cpf)
     for (i = 0; i < validInputs.length; i++) {