I am attempting to use jQuery Validate
, and one of my requirements is to validate some specific groups as they go through a wizard user interface. I cannot seem to locate the jQuery Validate documentation for this feature, though, and can only find very vague references to it online.
My declaration is essentially like this;
form.validate({
groups: {
raceGroup: "race",
identityGroup: "name gender age"
},
rules: {
race: {
required: true,
},
gender: {
valueNotEquals: "Select Gender ...",
required: true
},
name: {
pattern: "^(?!.*[ ]{2})(?!.*[']{2})(?!.*[-]{2})(?:[a-zA-Z0-9 \p{L}'-]{3,64}$)$"
}
},
messages: {
race: {
required: "this is a required for your character."
},
name: {
pattern: "You have entered an invalid name."
},
gender: {
valueNotEquals: "You must select a valid gender.",
required: "You must select a valid gender."
}
}
});
Okay, so I have the groups defined ... but now what? How can I check if everything within a group is valid? (or invalid)