Skip to content

Commit b36e7d3

Browse files
authored
docs: further specify alpha-rules and the permit_empty rule (#9818)
* Update validation rules to specify better Specified that the alpha-rules fail on empty strings and that permit_empty will skip all other rules except for required_with and required_without. * docs: missing dot * Update permit_empty rule description Clarify behavior of permit_empty validation rule. * Update permit_empty rule description in validation guide Clarify the behavior of the 'permit_empty' validation rule.
1 parent 2fa10e1 commit b36e7d3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,26 +900,28 @@ The following is a list of all the native rules that are available to use:
900900
Rule Parameter Description Example
901901
======================= ========== ============================================= ===================================================
902902
alpha No Fails if field has anything other than
903-
alphabetic characters in ASCII.
903+
alphabetic characters in ASCII or is empty.
904904
alpha_dash No Fails if field contains anything other than
905905
alphanumeric characters, underscores or
906-
dashes in ASCII.
906+
dashes in ASCII or is empty.
907907
alpha_numeric No Fails if field contains anything other than
908-
alphanumeric characters in ASCII.
908+
alphanumeric characters in ASCII or is empty.
909909
alpha_numeric_punct No Fails if field contains anything other than
910-
alphanumeric, space, or this limited set of
910+
alphanumeric, space, this limited set of
911911
punctuation characters: ``~`` (tilde),
912912
``!`` (exclamation), ``#`` (number),
913913
``$`` (dollar), ``%`` (percent),
914914
``&`` (ampersand),
915915
``*`` (asterisk), ``-`` (dash),
916916
``_`` (underscore), ``+`` (plus),
917917
``=`` (equals), ``|`` (vertical bar),
918-
``:`` (colon), ``.`` (period).
918+
``:`` (colon), ``.`` (period) or is empty.
919919
alpha_numeric_space No Fails if field contains anything other than
920-
alphanumeric or space characters in ASCII.
920+
alphanumeric or space characters in ASCII or
921+
is empty.
921922
alpha_space No Fails if field contains anything other than
922-
alphabetic characters or spaces in ASCII.
923+
alphabetic characters or spaces in ASCII or
924+
is empty.
923925
decimal No Fails if field contains anything other than
924926
a decimal number. Also accepts a ``+`` or
925927
``-`` sign for the number.
@@ -974,7 +976,9 @@ not_in_list Yes Fails if field is within a predetermined
974976
numeric No Fails if field contains anything other than
975977
numeric characters.
976978
permit_empty No Allows the field to receive an empty array,
977-
empty string, null or false.
979+
empty string, null or false. On success, it
980+
skips all other validation rules except for
981+
required_with and required_without.
978982
regex_match Yes Fails if field does not match the regular ``regex_match[/regex/]``
979983
expression.
980984
required No Fails if the field is an empty array, empty

0 commit comments

Comments
 (0)