Hopefully, this should be my last step in website coding, and I’m stuck.
I’ve created a multi-step booking form using slideshow on a dynamic page.
On slide1: some info is entered by the user
On slide2: other infos are entered.
On Slide 3: It’s a kind of Review page, where the user can review all the entries he entered AND some of the info that we’re brought in from the dynamic page being connected to a dataset.
After reviewing, he can confirm and submit the info by clicking a button.
So basically, the last slide is a bunch of texts returning the data he entered in the user input field, and some texts returning some info from the dynamic page.
Is there a way to connect the #texts return on the last slide to my form submission dataset (not the #input fields themselves)?
When I tried to connect the text elements to fields in the data collection, and click submit button, it shows empty (probably because the submit button only takes the data from the input element and not the text element)
I’m not quiet sure I understand that coding. Let me tell you what i understand from it.
toInsert is telling the code to write the text or input into a field called name (so if the field in the collection is for example firstname, it would be toInsert.firstname, right)
and then the wixData.insert, tells it to insert these saved inserts in this collection name.
but what’s the .then(() => {/show message/}? do you mean like a success or failure message? what if I want to direct it to a thank you pgae, instead of showing a message?
toInsert is the data object you’re going to insert. This object’s properties are your collection field keys. So yes - toInsert.firstname defines the value for the firstname field.
wixData.insert is the insert command.
Yes, it’s the success message. If you want to redircet the user then:
import wixLocation from 'wix-location';//this line should be at the top of your page code.
//code...code...
.then(() => wixLocation.to("/successpage")); //use the page path
//code...