1
good afternoon!
I’d like to help on a little something here, I have a name field from the card and I’d like to validate it to see if it’s empty, made and works only that the time I click on the message that Alert sent it does not return the focus to the input but keeps giving the message as if it was in an infinite loop. Can anyone help me!!
Follows Code.....
JS
function validanome(){
if (document.getElementById("nomecartao").value == ""){
alert("Por Favor Insira o Nome do Titular!!!");
document.getElementById("nomecartao").focus();
}
}
HTML
<input type="text" class="nomecartao" name="nomecartao" id="nomecartao" maxlength="100" onblur="validanome()" onkeyup="mostrar()">
Your second question is duplicate and avoid two questions in the same post https://answall.com/questions/106728/como-n%C3%A3o-allow-n%C3%Bameros-numa-textbox
– Giovanni Dias