Skip to content

[Book][Forms] describe the allow_extra_fields form option #4084

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on all types for which ``form`` is the parent type.

+-----------+--------------------------------------------------------------------+
| Options | - `action`_ |
| | - `allow_extra_fields`_ |
| | - `by_reference`_ |
| | - `cascade_validation`_ |
| | - `compound`_ |
Expand Down Expand Up @@ -52,6 +53,20 @@ Field Options

.. include:: /reference/forms/types/options/action.rst.inc

allow_extra_fields
~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.6
The ``allow_extra_fields`` option was introduced in Symfony 2.6.

**type**: ``boolean`` **default**: ``false``

Usually, if you submit extra fields that aren't configured in your form,
you'll get a "This form should not contain extra fields." validation error.

You can silence this validation error by enabling the ``allow_extra_fields``
option on the form.

.. include:: /reference/forms/types/options/by_reference.rst.inc

.. include:: /reference/forms/types/options/cascade_validation.rst.inc
Expand Down