I'm trying to validate the input using required and customizing the error message with oninvalid
however when I fill in the field I tried to submit without filling, for every character I type it shows the error message, ie the onchange does not change the status of the field.
Would anyone know what this could be?
<input type="text" name="nome" id="nome" placeholder="Nome" required oninvalid="setCustomValidity('Insira o seu nome')" onchange="try{setCustomValidity('')}catch(e){}">