Save form into another form Hi,
I have a question, is it possible to save child form into parent form ?
I have a user_form, inside this form, I put address_form.
In my database user has a column named "address_id".
What is the best way to save the user and address and fill in the address_id with the new address that has just been saved ?
yes, you can do something like that. but why make it complicated?
address_form is inside another component.
When I save user_form, I dispatch a event to address_form to save new address and update user with address_id and it works perfectly, but after saving, I redirect to another page and on this page address_id is null until I refresh the page.
I did not use controller, only livewire component/form.
I put address form fields into user form, modify my component and it works well. But ideally I'd like to create a reusable component Address.
Why not try to save the first and if input is validated, save either to cache then hide the first form to show the second form use if/else
Please sign in or create an account to participate in this conversation.