Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Multisteps form or wizard form

Started by Dimitri Longo 7 years ago · 8 replies · 1246 views
7 years ago

Hello,

I need to create a multistep ( same page). Does anybody have info about it ?
With plugin forms 2.0 I can include multiple forms but need to aggregate to a single email. Not sure is the right direction. Any infos about will help

7 years ago

Your question puzzles me. Maybe we can work something out. Please regard my suggestions here as a starting point towards a solution.

Using the Add Page by Form Plugin you can pass form field values from one form (in step x) to the next as form values get transferred to a new page frontmatter where they can be used by a form on that new page (in step x+1).

To pre-fill normal or hidden fields with values entered in a previous step you could use the Form Prefiller Plugin. Actually your question was the final push that had me create it.

Although this could make for a multistep or wizard like flow it uses multiple pages and is not a single page Ajax behaviour solution. Furthermore it leaves a trail of new site pages.

But as I said maybe it's something to build upon?

7 years ago

hi @bleutzinn

thanks a lot for yours suggestions. I found one solution, i create a field attribute called step to know which field belong to step1 or 2 etc in my frontmatter then in my custom form.html.twig i create my multistep kind of switcher with previous and next button (switch from step 1 to 2 for instance), it works great, all data sent in one email, last job :

  • make a validation by step, so user can't go to step 2 if step 1 not validated etc,

as an alternative i will check Form Prefiller Plugin, seems great plugin

last edited 06/18/19 by Dimitri Longo
7 years ago

hey @dimitrilongo

is there any way I can take a look at your solution. I would like to understand how I can create a multistep form, but I have no Idea. 😃

At the moment I got a modular page with multiple select fields in the backend, where I choose which field should be added in the frontend. I choose the type and add a label, which are loaded in the html tag.

7 years ago

hi @dorian.design

was away, i will post or send PM with my solution, just validation is needed

6 years ago

hi guys have you managed to get this multistep form done yet ? I was thinking about the same thing now and perhaps you could help out a solution ?

thanks in advance

6 years ago

not yet but I am working on a different approach to bypass fully the Grav from and just post the JSON to an endpoint , then process and sanitize the input and then email it .
I managed to get the the POST the json, not its time to build a custom plugin that would manage the form information and email

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 3 days ago
2 70 5 hours ago
General · by pamtbaau, 10 hours ago
1 45 9 hours ago
General · by Andy Miller, 22 hours ago
0 43 22 hours ago
General · by Marcel, 12 months ago
6 341 4 days ago
General · by Duc , 5 days ago
3 35 5 days ago