Javascript
function user(){
input = document.getElementById("user").value;
label = document.getElementById("tuser");
if(label.style.display == "block"){
if(input.length >= 1){
label.innerHTML = "Usuário deve conter mais 5 caracteres.";
if(input.length >= 5){
label.style = "display:none";
}
}
}
}
function pass(){
input = document.getElementById("pass").value;
label = document.getElementById("tpass");
if(label.style.display == "block"){
if(input.length >= 1){
label.style = "display:none";
}
}
}
Both are not running, so it returns an error in the Chrome Console
(index):225 Uncaught TypeError: pass is not a function
at HTMLInputElement.onkeypress ((index):225)
HTML (call function)
<input type="text" name="usuario" id="user" onkeypress="user()" autofocus maxlength="12" value="" class="form-control" placeholder="Seu Usuário">
<input type="password" name="senha" id="pass" onkeypress="pass()" maxlength="16" class="form-control" placeholder="Sua Senha">
Function will make change in
<font color="#ff0000" id="tuser" class="animation-slideUp inserted" style="display:none;">Insira seu usuário.</font>
<font color="#ff0000" id="tpass" class="animation-slideUp inserted" style="display:none;">Insira sua senha.</font>
I found it very strange that this happened, because the codes are "correct" (I think). I ran them on the console and there were no errors.