Forked from robhimself82/ajax_jquery_email-validation
Created
August 26, 2014 03:55
-
-
Save RimonEkjon/9496b6c4ae64597b5d58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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