Explorar el Código

giving cpf input mask

BuildTools hace 3 años
padre
commit
4430cf3d4e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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++) {