Trying to use the the jQuery Form Plugin and jQuery Validate plugin together, but the form will submit with AJAX even if the required fields are blank. Here is my code:
// prepare the form when the DOM is ready
$(document).ready(function() {
// bind form using ajaxForm
$('#contact-form').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#ajax-success',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$('#contact-form-wrapper').hide();
$('#ajax-success').fadeIn('slow');
}
});
});
The documentation for the validate plugin shows how to do this.
Look at the
submitHandlerfunction.