5
Hello, I’m starting to learn Javascript and I’m not being able to validate my code if there are 3 characters in uppercase, 2 numbers and 1 special character in my input. I would like to know what I must be doing wrong, because I have made several attempts, researched several sites and no way works. Follows the base code:
/* Validação do Campo Senha*/
if (document.formulario.senha.value.length < 8) {
alert("A senha deve conter no minímo 8 digitos!");
document.formulario.senha.focus();
return false;
}
Thank you for your attention!
The code worked more unfortunately the only information it presents is that of "Else if".
– Larissa Mourullo
Excellent @Felipe, much more practical
– Maicon Carraro
Imagine @Maiconcarraro! Yours checks for more special characters.
– Felipe Douradinho
@Larissamourullo, I don’t understand, how so the only information is from
else if
?– Felipe Douradinho