EasyCorp/EasyAdminBundle

allow dynamically generated forms

wizhippo opened this issue · 0 comments

Currently a form is always saved if submitted regardless if a ['ea']['newForm']['btn'] button was pressed

I propose to not process and save the form unless a valid button is pressed.

This will allow dynamically generate forms to work correctly so the ajax call can retrieve the updated dom without saving first.

Example of how to use this feature
Following the symfony documentation create a new form type that has a field that is added if another field such as a select has a specific value.

Create a FormField using this new formtype and the supporting javascript to submit and retrieve the html for the dynamic field using the example documentation as a guide.

If the proposed behavior is added, then this will work as expected, as the request will not cause the entity to be saved without a correct button present.