You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for advice on the best way to implement array entries using separate insert form. Specifically, I want to manage add and edit actions for array entries through separate forms, and I’d like to avoid some common pitfalls like nested forms.
In your documentation examples, array entries are typically edited using the same inputs that display them. In my case, however, I want to manage these actions in separate forms as there is some business logic attached to them and I also want to achieve that updates are controlled. Meaning that I only want to update the actual array entries when the user submits add or edit form, and not while the user is editing inputs.
What I’ve Considered
Splitting the functionality into a parent form for managing the array and child forms for handling the logic of adding/editing entries. The child form would take in onSubmit methods that would get executed on submit, effectively triggering updates in the parent form.
Questions
What is the recommended approach for structuring forms in this scenario?
Are there any examples or best practices for avoiding pitfalls with separate forms while ensuring seamless data flow?
Any advice, examples, or pointers would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm looking for advice on the best way to implement array entries using separate insert form. Specifically, I want to manage
add
andedit
actions for array entries through separate forms, and I’d like to avoid some common pitfalls like nested forms.In your documentation examples, array entries are typically edited using the same inputs that display them. In my case, however, I want to manage these actions in separate forms as there is some business logic attached to them and I also want to achieve that updates are controlled. Meaning that I only want to update the actual array entries when the user submits add or edit form, and not while the user is editing inputs.
What I’ve Considered
Splitting the functionality into a parent form for managing the array and child forms for handling the logic of adding/editing entries. The child form would take in onSubmit methods that would get executed on submit, effectively triggering updates in the parent form.
Questions
Any advice, examples, or pointers would be greatly appreciated!
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions