Remember input data between multiple pages, before user submit form.

Hi guys.

I’m completely new to coding, any help is much appreciated:

I’m building a form based website from scratch. The site has 5 different pages with a “go to next page button” on the bottom of each page, and on the last page the user clicks the submit button.

I want to give the user the ability to jump between pages without loosing the input he/she has already filled in.

From what I’ve read I need to use local or session storage, but I have no clue how to set that up.

Do I just paste import {sessionl} from ‘wix-storage’; on top of each code editor and it should be working? Well, thats not working. What else do I need to do?

Thank you!

You can use the wix-storage API which allows you to save and retrieve data from a user session or sort of permanent. Importing wix-storage in your code only enables you to use the API. You will need to follow the code example snippets that are in the documentation to do what you need.

Thanks Yisrael. I looked at the link. So how do I use/find the API? I wish I could ask more specific but I’m too much of a newbie and those examples confuses me. Thank you.

Have a look at this Wix example for a multi stage form as I think it would benefit you on what you are planning to do with your website.
https://www.wix.com/corvid/example/multistage-form

As for the Wix Storage API and all its functions, then if you want to pass info to and from pages then simply use the getItem and the setItem functions.

If you are wanting to do it between page and lightbox or lightbox to page, then you need to look at the Wix Window API and the lightbox functions and this does have full code examples of how to share the data between both instead of just the little code snippets.
https://www.wix.com/corvid/reference/wix-window.lightbox.html

Also, if you use this forum’s own search function in the top right of the header and simply search for Wix Storage, then you will find a lot of previous forum posts about using it which in turn will have a lot of code that can help you, along with a lot more Wix pages etc telling you more about how to use it and much more.

Thank you so much!