diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index dfe67119f6c..43ab188086a 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -59,3 +59,8 @@ on all fields. .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc +.. include:: /reference/forms/types/options/extra_fields_message.rst.inc + +.. include:: /reference/forms/types/options/post_max_size_message.rst.inc + +.. include:: /reference/forms/types/options/pattern.rst.inc diff --git a/reference/forms/types/options/extra_fields_message.rst.inc b/reference/forms/types/options/extra_fields_message.rst.inc new file mode 100644 index 00000000000..d130808191c --- /dev/null +++ b/reference/forms/types/options/extra_fields_message.rst.inc @@ -0,0 +1,9 @@ +extra_fields_message +~~~~~~~~~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``This form should not contain extra fields.`` + +This is the validation error message that's used if the submitted form data +contains one or more fields that are not part of the form definition. The +placeholder ``{{ extra_fields }}`` can be used to display a comma separated +list of the submitted extra field names. diff --git a/reference/forms/types/options/pattern.rst.inc b/reference/forms/types/options/pattern.rst.inc new file mode 100644 index 00000000000..d1ff3aea732 --- /dev/null +++ b/reference/forms/types/options/pattern.rst.inc @@ -0,0 +1,18 @@ +pattern +~~~~~~~ + +**type**: ``string`` **default**: ``null`` + +This adds an HTML5 ``pattern`` attribute to restrict the field input by a +given regular expression. + +.. caution: + + The ``pattern`` attribute provides client-side validation for convenience + purposes only and must not be used as a replacement for reliable + server-side validation. + +.. note: + + When using validation constraints, this option is set automatically + for some constraints to match the server-side validation. diff --git a/reference/forms/types/options/post_max_size_message.rst.inc b/reference/forms/types/options/post_max_size_message.rst.inc new file mode 100644 index 00000000000..f85cb83a99d --- /dev/null +++ b/reference/forms/types/options/post_max_size_message.rst.inc @@ -0,0 +1,12 @@ +post_max_size_message +~~~~~~~~~~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``The uploaded file was too large. Please try to upload a smaller file.`` + +This is the validation error message that's used if submitted POST form data +exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}`` +placeholder can be used to display the allowed size. + +.. note: + + Validating the ``post_max_size`` only happens on the root form.