Skip to content

[Form] Form Events documentation incorrectly states fields cannot be removed/added during SUBMIT event #5990

Closed
@bkosborne

Description

@bkosborne

The form events page indicate

"At this point, you cannot add or remove fields to the form."

when describing the SUBMIT event. It then follows up with an example listener that the Form component provides:

The Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener subscribes to the FormEvents::SUBMIT event in order to remove the fields that need to be removed whenever manipulating a collection of forms for which allow_delete has been enabled.

Indeed, when looking at the code for that listener, you can see that it is removing fields from the form, which the docs indicate cannot be done.

If someone confirms this is indeed an error, I'll create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormactionableClear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions