How to validate multiple select fields with just one error message
Hey!
I'd like to validate the folllowing 3 select fields at once.
- <select id="day" class="birthdate day" name="birth_date_day">...</select>
- <select id="month" class="birthdate month" name="birth_date_month">...</select>
- <select id="year" class="birthdate year" name="birth_date_year">...</select>
This is the validation method:
- jQuery.validator.addClassRules({
birthdate: {
validBirthdate: true
}
});
(validBirthdate is a selfmade method)
The validation itself runs fine.
My Problem is, that the plugin always validates each field, and returns an error message for each field.
But this fields are combined, and it should only return one error message behind the elements. Is this possible?
I've tried many ways (adding a new function, change the form element name (e.g. birthdate[day]), etc)
Thanks for your help