Skip to content

Commit d3ee46b

Browse files
committed
Merge pull request #3449 from bicpi/add_missing_form_options
[WIP][Reference][Form Types] Add missing options for "form" type
2 parents f285d93 + a42e971 commit d3ee46b

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

reference/forms/types/form.rst

+5
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ on all fields.
5959

6060
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
6161

62+
.. include:: /reference/forms/types/options/extra_fields_message.rst.inc
63+
64+
.. include:: /reference/forms/types/options/post_max_size_message.rst.inc
65+
66+
.. include:: /reference/forms/types/options/pattern.rst.inc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extra_fields_message
2+
~~~~~~~~~~~~~~~~~~~~
3+
4+
**type**: ``string`` **default**: ``This form should not contain extra fields.``
5+
6+
This is the validation error message that's used if the submitted form data
7+
contains one or more fields that are not part of the form definition. The
8+
placeholder ``{{ extra_fields }}`` can be used to display a comma separated
9+
list of the submitted extra field names.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pattern
2+
~~~~~~~
3+
4+
**type**: ``string`` **default**: ``null``
5+
6+
This adds an HTML5 ``pattern`` attribute to restrict the field input by a
7+
given regular expression.
8+
9+
.. caution:
10+
11+
The ``pattern`` attribute provides client-side validation for convenience
12+
purposes only and must not be used as a replacement for reliable
13+
server-side validation.
14+
15+
.. note:
16+
17+
When using validation constraints, this option is set automatically
18+
for some constraints to match the server-side validation.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
post_max_size_message
2+
~~~~~~~~~~~~~~~~~~~~~
3+
4+
**type**: ``string`` **default**: ``The uploaded file was too large. Please try to upload a smaller file.``
5+
6+
This is the validation error message that's used if submitted POST form data
7+
exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}``
8+
placeholder can be used to display the allowed size.
9+
10+
.. note:
11+
12+
Validating the ``post_max_size`` only happens on the root form.

0 commit comments

Comments
 (0)