What happens is that when sending the form, if there is an error, a message is displayed in a div, this only happens the first time, then I keep pressing the submit, but I do not see the error message.
ajax function:
function login(){
login.submit();
}
function ValidarRequeridos(){
divResultado = document.getElementById("resultado");
var Usuario = document.getElementById("Usuario").value;
var Password = document.getElementById("Password").value;
ajax = newAjax();
ajax.open("POST", "login_verify.php",true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
//mostrar resultados en esta capa
divResultado.innerHTML = ajax.responseText;
$("#resultado").delay(2000).hide(300);
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//enviando los valores
ajax.send("Usuario="+Usuario+"&Password="+Password);
};