I want to create a form where the user can create a row and if the user revisits this page, the form should display the previously entered data and by resubmitting the form the data should be updated.
To me this seems like a pretty standard task, I was wondering if it is possible to create this using just vanilla wix elements without code?
ihi Julien,
Its an easy task indeed, you won’t need any code.
What you should do is follow this
This way you let members add a form to a collection.
then you should make an member page and do olmost the same.
You add the needed fields (textFields)
and a button (Update button)
add a dataset (your form collection)
and link the needed textfields to the dataset.
Then link the button and let it update instead of inserting.
Kind regards,
Kristof.
Hey Kristof,
thank you, but i can’t implement it that way, since the form to create and update should be the same (at least in the eyes of the user), so adding another form in the members area isn’t an option.
At the moment i created the form and linked it up to my dataset / collection. If I set the dataset to write only it lets me create the entry as expected, but if I set it to Read/Write it will disable the form (except the user already created an entry, then it works as expected but the user won’t get to that point since he can’t create it in the first place). Do you know a way to use the same form for this purpose?
@juliendavid
Oke thats a bit more difficult .
i’ll try to make an example this evening.
About the Read/Write.
This is to update only not to submit something that isn’t there yet.
You will hear from me in about an hour or 2 -3.
Kind regards,
Kristof.
HI Julien,
Sorry it took so long but i finshed my tutorial.
Go to my website and make an account.
Go to the members area and go to the Form submit/update page.
It should do what you need and i added some info below it.
https://volkaertskristof.wixsite.com/helpcenter
Also let me know your toughts about the tutorial.
didn’t had much time so there aren’t any images. only a live example
Kind regards,
Kristof.
Hey Kristof, thank you very much for your engagement.
I just had a look, I see you worked around that limitation by switching out the container right?
I could follow the tutorial and implemented it on my site without a problem. So I think it’s easy to follow.
I adjusted it a bit to avoid the additional container and dataset:
$w("#my-dataset").onReady( () => {
if ($w("#my-dataset").getCurrentItem() === null) {
$w("#my-dataset").new()
}
} );
});
Thank you very much!
Julien
I’m glad it worked as needed 
And your welcome
Kind regards,
Kristof
Hi Kristof,
Thanks so much for this information. May I ask you, how did you make sure that the data is referenced to the member who submits the data? How does the form and dataset know to save it for a particular member?
Thanks!