Hi - I need to create a form that has submit after the first part (to save data in case users choose not to complete the form) and then a final submit after the second part.
I’m using the slide show option to stay on the same page, but when the user hits the first submit the data base moves to the following line (e.g. for the same user, info in columns A and B will be on line 2 and for questions in columns C and D will be on line 1). I need to keep all of the data on the same line in the database.
I tried making the database write&read to go back a line after the user hits the first submit, but that causes a whole lot of other problems and I’ve been advised it should be write only database.
Any suggestions how to code this?
Hi Vicky!
Have you seen this WixCode example?
It sounds like it might be exactly what you were looking for.
Doron.
Thanks Doron
I saw this, but it doesnt have the option to submit after the first slide (which is what I need). This example assumes that the user only submits the data once, at the end. I need to add to this some code that allows me to submit after the first slide, and then at the end, but have all of the data in the same line in the database (so it is attributed to the same user, and doesnt appear as two separate users in the database).
@vickyabc86
You would update the field values in your database on the next slide, but why on earth would you want to set your form up like that ?
import wixData from ‘wix-data’;
// …
let toUpdate = {
“_id”: “00001”,
“title”: “Mr.”,
“first_name”: “John”,
“last_name”: “Doe”
};
wixData.update(“myCollection”, toUpdate)
.then( (results) => {
let item = results; //see item below
} )
.catch( (err) => {
let errorMsg = err;
} );