I have the following function: if the entered data is NaN, it gives focus to the field and changes the border
function validaNumero(){
dado = document.getElementById("new_partner");
var formulario = document.getElementById("new_partner");
var dado = formulario.partner_registry_number.value;
if(isNaN(dado)) {
formulario.partner_registry_number.style.focus;
formulario.partner_registry_number.style.border = "2px solid red";
return false;
}
}