简体   繁体   中英

Symfony: How to Dynamically Modify Forms Using Form Events

I'm trying to dynamically add a new input field using the official cookbook tutorial:

http://symfony.com/doc/2.8/cookbook/form/dynamic_form_modification.html#dynamic-generation-for-submitted-forms

but using POST_SUBMIT event (as the official tutorial suggests) I get the following error:

You cannot add children to a submitted form

Take a look at Form Events docs . The last event you can use for modifying the form is FormEvents::PRE_SUBMIT event.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM