-1
Guys I’m a beginner in the area and wanted to know how I validate Cpf with javascript mask, I’ve been searching and I couldn’t find one that did both at the same time. I have an example that I had done that in the case the validation was done online, but the site that I used the validation went off the air. From Now Thank You.
<html>
<head>
<title>Validar CPF com Máscara by TchekiGamer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="language" content="PT-BR"/>
<script src="http://www.geradorcpf.com/scripts.js"></script>
<script src="http://www.geradorcpf.com/jquery-1.2.6.pack.js"></script>
<script src="http://www.geradorcpf.com/jquery.maskedinput-1.1.4.pack.js"></script>
</script>
<script type="text/javascript">$(document).ready(function(){
$(".cpf").mask("999.999.999-99");
$("#cpf").blur(function (){
if($("#cpf").val() == '') {
$("#saida").html("Informe um CPF");
return false;
}
if(validarCPF($("#cpf").val())) {
$(".cpf").css('border-color','limegreen');
}
else {
$(".cpf").css('border-color','red');
}
});
});
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center" id="saida1">
<label>Digite o seu cpf</label>
<input name="cpf" type="text" class="cpf" id="cpf">
</div>
<div align="center" id="saida1">
<label>Teste</label>
<input name="teste" type="text" class="teste">
</div>
<div align="center" id="saida" class="style7"> <!--aparece mensagem de CPF Invalido--> </div>
</form>
</body>
</html>
Thank you very much Colleague ,helped me a lot, it was exactly what I was needing
– Guilherme Henrique