I'm using the jQuery validate plugin to validate a form. All fields are mandatory and space for error messages is limited on the form, so is it possible to show a single error message if any of the fields from my rules aren't completed which says, 'All fields must be completed before you submit the form' ?
My jQuery knowledge is limited and I can only figure from examples how to set it up so that it outputs individual error messages for each field using the following code:
$(".contact-form").validate({
errorLabelContainer: ".form-errors",
wrapper: "li",
ignore: ".ignore",
errorElement: "em",
rules: {
first_name: { required: true },
last_name: { required: true },
email: { required: true, email: true }
},
messages: {
first_name: "Please enter your first name",
last_name: "Please enter your last name",
email: { required: "Please enter your email address", email: "Your email address must be in the format of name@domain.com" }
},
});