Hello, I'm creating a custom multi-step form, and the basic functions of saving data to the database and changing slides are working. However, the problem is each step of the form saves data into a separate row in the database.
One peculiarity is that I used custom code on a regular button (not a Wix "user input" button) to create user input. However, on the next slide, I used a Wix "user input" text box.
Is there any way I can tweak the code so that each step of the forms are connected and saved to the same row in the database collection?
The code on the button is:
export function button11_click(event, $w) { let toInsert = { "FTHBy": "yes", }; wixData.insert("CustomDatabase", toInsert) .then( (results) => { let item = results; } ) .catch( (err) => { let errorMsg = err; } );
$w("#slideshow2").changeSlide(1);
Note: I also tried the "save" function instead of "insert", but the result is the same.
Thank you
HI!
1. You can use Button with new Action to add new record, Read& Write dataset mode and Buttons with Submit action to update for every slide, note you need uncheck required Setting for inputs to add data in the same record
2. Another way - submit a record 1st time and get & update one each next slide https://www.wix.com/code/reference/wix-data.html#get , https://www.wix.com/code/reference/wix-data.html#update