From f7e86e491fc109e4738a3dfcbd1e7c559e8682c3 Mon Sep 17 00:00:00 2001 From: Simon Freytag Date: Wed, 16 Oct 2013 21:56:25 +0100 Subject: [PATCH 1/2] Added documentation for the additional method, require_from_group. --- entries/require_from_group-method.xml | 43 +++++++++++++++++++++++++++ pages/documentation.md | 1 + 2 files changed, 44 insertions(+) create mode 100644 entries/require_from_group-method.xml diff --git a/entries/require_from_group-method.xml b/entries/require_from_group-method.xml new file mode 100644 index 0000000..e2f16af --- /dev/null +++ b/entries/require_from_group-method.xml @@ -0,0 +1,43 @@ + + + require_from_group method + nsures a given number of fields in a group are complete. + + In the options passed to the rule, define the minimum number of fields + within the group that must be complete and a CSS selector to define the + group. Then apply this rulke to all the fields within the group. + The form then cannot be submitted until at least the minimum number have + been completed. + + + Within a group of three phone numbers, ensure at least one is complete. + +Mobile phone: + +
+ + +
+ + +
+ +]]> +
+ +
diff --git a/pages/documentation.md b/pages/documentation.md index 0e4c552..1645411 100644 --- a/pages/documentation.md +++ b/pages/documentation.md @@ -129,6 +129,7 @@ Some more methods are provided as add-ons, and are currently included in additio * [`accept` - Makes a file upload accept only specified mime-types.](/accept-method) * [`extension` - Makes the element require a certain file extension.](/extension-method) * [`phoneUS` - Validate for valid US phone number.](/phoneUS-method) +* [`require_from_group` - Ensures a given number of fields in a group are complete.](/require_from_group-method) # [General Guidelines](/reference) From cc55b3228ed34d38e642226a5f1996f52613067c Mon Sep 17 00:00:00 2001 From: Simon Freytag Date: Wed, 16 Oct 2013 22:05:34 +0100 Subject: [PATCH 2/2] Corrected some typos in the docs for require_from_group. --- entries/require_from_group-method.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/require_from_group-method.xml b/entries/require_from_group-method.xml index e2f16af..f126768 100644 --- a/entries/require_from_group-method.xml +++ b/entries/require_from_group-method.xml @@ -3,9 +3,9 @@ require_from_group method nsures a given number of fields in a group are complete. - In the options passed to the rule, define the minimum number of fields + In the options passed to the rule, supply the minimum number of fields within the group that must be complete and a CSS selector to define the - group. Then apply this rulke to all the fields within the group. + group. Then apply this rule to all the fields within the group. The form then cannot be submitted until at least the minimum number have been completed.