Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adds requireGroup rule #14

Open
CodyMcMichael opened this issue Mar 3, 2018 · 0 comments
Open

Adds requireGroup rule #14

CodyMcMichael opened this issue Mar 3, 2018 · 0 comments

Comments

@CodyMcMichael
Copy link
Collaborator

requireGroup – Ensures a given number of fields in a group are complete.

example validation config:

contactRequest: {
  mobile: { phoneUS: true, requireGroup: "phoneNumber" },
  home: { phoneUS: true, requireGroup: "phoneNumber" },
  work: { phoneUS: true, requireGroup: "phoneNumber" },
}
  • Returns boolean

Expected outcome
In the options passed to the rule, supply a selector to define the
group. Then apply this rule to all the fields within the group.
Validation is not valid until at least 1 property has
been completed.

(e.g. a user must fill out either the mobile phone field, or the home phone field.)

Enhancement
Extend the rule to take in a min-required number to also validate against.
we do not currently have a set delineation standard. Could be space separated string or array of values

  • In the example above requireGroup: "2 phoneNumber" || requireGroup: [2, "phoneNumber"]

The validation is not valid until at least the minimum number have
been completed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant