Hi, I have a form which is validated through jquery, but I need the blur event to fire again once the submit button is checked, in case the user deletes anything. It shows an error but the "tick" is still displayed next to the text box, as this only changes on the blur event.
How can I toggle the blur event to all text boxes to re-validate them?
Thanks
edit: added code
if(httpxml.readyState==4)
{
if (httpxml.responseText.indexOf("Successful") >= 0)
{
$("#result").show("slow");
$("#result").html("Project request has successfully been sent");
$("#result").removeClass("result_error");
}
else if (httpxml.responseText.indexOf("Fail") >= 0)
{
$("#result").html("One or more errors have occured, please fix and submit again");
$("#result").addClass("result_error");
$("#result").show("slow");
$(':text').trigger('blur'); <<--- Blur text boxes here
}
}
checking:
function check_email(email)
{
var httpRequest;
make_request()
$("#loading").show();
function stateck()
{
if(httpxml.readyState==4)
{
if (httpxml.responseText.indexOf ("Email Ok") >= 0)
{
$("#email_tick").show();
$("#email_cross").hide();
$("#email_error").hide("normal");
$("#loading").hide();
emailok = true;
}
else
{
$("#email_tick").hide();
$("#email_cross").show();
document.getElementById('email_error').innerhtml = "Invalid email";
$("#email_error").show("slow");
$("#loading").hide();
emailok = false;
}
checkCanSubmit();
}
}
httpxml.onreadystatechange=stateck;
email_url="../checking/check_email.php?email=" + email.value;
httpxml.open("GET",email_url,true);
httpxml.send(null);
}