我正在尝试使用jQuery Validate
,我的要求之一是在某些特定组通过向导用户界面时对其进行验证。不过,我似乎无法找到此功能的 jQuery Validate 文档,只能在网上找到非常模糊的引用。
我的声明基本上是这样的;
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."
}
}
});
好的,所以我已经定义了组......但是现在呢?如何检查组内的所有内容是否有效?(或无效)