Help with creating an edit form
Unanswered
French Angora posted this in #help-forum
French AngoraOP
Hello everyone. I’m looking to implement this in my page for a single vehicle. It will be essentially a details page. However I thought of also making it editable. The problem is I’m not sure how I should do it. This is the desktop version but essentially my app will Kailey be used on mobile so I don’t want to hit an edit button and another page opens up. I was thinking of adding an edit button and then you can edit the fields then hit save. But not sure if I need to make the whole thing a form or each component a form. Each section is essentially an individual component. Never done something like this before so I would appreciate any feedback. Also technical specks is a json field in my db so it will be a bit more dynamic when displaying data. And I was planing on using server action. What do yall think? Thank you all
9 Replies
French AngoraOP
Ok I thought some more about this and noticed that I don’t need to allow the user to update everything. Really only the technical specs, components sections and the first section but only the vehicle info part . Since everything else has a dedicated section. Like maintenances has its own page where users can add or edit them. However I’m still a bit confused as to how I can make this inline editing.
French AngoraOP
Right I wanted to know how inline editing would work. But I think I just need to show two similar components and have an if checking if is editing is true. Then show the form instead of the display data. And use server actions on a submit
You could have an edit button hide/show an input with the init data as the default vale and another button to submit the data for the mutation
@French Angora
French AngoraOP
I do like that idea. Thank you
Please Mark answered @French Angora
and you're welcome!