I have a form that is marked up something like this:
<form>
<label for="day">Day</label><input type="text" name="day" id="day">
<label for="month">Month</label><input type="text" name="month" id="month">
<label for="year">Year</label><input type="text" name="year" id="year">
</form>
Unfortunately, the names on the fields are going to be dynamic and won't be known until runtime. There are 3 fields that are required and would like them to have 1 error message.
I tried to populate the groups using a variable called myGroupData, but it does not work. The code would look something like this:
$('#myform').validate({
rules...,
groups myGroupData,
errorPlacement
});
var myGroupData = {DateofBirth: "day month year"};
or
var myGroupData = {DateofBirth: "field1 field2 field3 etc..."}' //field1, field2, field3 will be the names of the dynamic fields
Thanks, any help would be appreciated.