Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RimonEkjon/9496b6c4ae64597b5d58 to your computer and use it in GitHub Desktop.
Save RimonEkjon/9496b6c4ae64597b5d58 to your computer and use it in GitHub Desktop.
$("#contact_form").validate({
submitHandler: function(form) {
$.ajax({
type: "POST",
url: "util/misc_func.php",
data: {
action: "validate_domain",
email: $("#form_email").val()
},
success: function(output) {
// If the domain exists we'll see "true."
if (output == "true") {
// If any validation errors are showing get rid of them.
$("#form_email").parent().find(".error").remove();
// Submit the form.
form.submit();
} else {
$("#form_email").parent().append(domainError);
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment