Skip to content
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

allow dynamically generated forms #6286

Open
wizhippo opened this issue Apr 26, 2024 · 0 comments
Open

allow dynamically generated forms #6286

wizhippo opened this issue Apr 26, 2024 · 0 comments

Comments

@wizhippo
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant