Eibich
February 29, 2020, 9:28am
1
Hello, community,
First of all thank you for the great product Wappler. 10 years ago I worked with Dreamweaver but the development is a disaster.
I’m just getting used to Wappler and I already find my way around.
Now to my question:
I would like to create a form that consists of several steps. Each step is a single .php file. So there are 5 steps and 5 files.
Currently I take the values and store them in a “Local Storage” database. At the end the data is written to a MySQL database.
The problem is when I add a field in a file I have to edit the local storage database in each step and edit the variables.
Is there a way that is better? Can I somehow define global variables and use them in each step?
Thanks a lot!
max_gb
February 29, 2020, 12:18pm
2
Hi @Eibich , Have you tried the data store component yet?
I find it far easier that local storage, plus you can easily post your form values to your database at the last step. Local storage through Data Store will also pass between pages too.
Eibich
February 29, 2020, 1:35pm
3
But the “data store” component has the same behaviour like the “local storage”?
When I edit fields/structure in one file I have also to edit all the other files too?
Or am I wrong?
George
February 29, 2020, 1:42pm
4
Yes the data store is based on local storage but gives you easy access to it with its actions.
Eibich
February 29, 2020, 1:50pm
5
This is such a usefull information. Just found it in the shopping cart tutorial.
Please optimize your documentation or add more tutorials!
1 Like
George
February 29, 2020, 1:53pm
6
Well suggestions and help for better organization are always welcome
Eibich
February 29, 2020, 2:05pm
7
Are you accepting and publishing user made tutorials?
George
February 29, 2020, 2:33pm
8
Yes actually all the official documentation at https://docs.wappler.io is generated straight from the forum category #docs after we approve it.
brad
February 29, 2020, 4:43pm
9
Hi Tobias,
Welcome to Wappler! Have you seen this documentation?
Got a long form on your website? Break it up into smaller logical sections and convert it into a multi-step form easily. In this tutorial we will show you a very basic form, but you can extend it as per your requirements adding more inputs, using different layout etc.
Creating a Variable
First we need to add a variable on our page. This variable will control the active step in our form.
In the App Structure panel, add new component:
[Screenshot_1]
Open the Data menu and select Variable:
[…