Code:
function valida_form (){
var filter_nome = /^([a-zA-Zà-úÀ-Ú0-9]|-|_|\s)+$/ ;
if(!filter_nome.test(document.getElementById("input_nome_cad").value)){
document.getElementById("input_nome_cad").value='';
document.getElementById("input_nome_cad").placeholder = "Nome inválido";
document.getElementById("input_nome_cad").focus();
document.getElementById("input_nome_cad").style.borderColor = "#ff0000";
document.getElementById("input_nome_cad").style.outline = "#ff0000";
return false;}
}
The code above does a check in an "input text", if the field is not valid, the changes in the style are realized.
However, after completing the correct field and jumping to the next field, the field where the style was changed remains, such as returning to the original style after the correct field completion?