Buy Now
Sign in

Multipage - Save to session on back button?

morphz , February 12 at 08:43
M
morphz
Hello everyone.
I set up a multipage form.

​I'd like to save the data they enter on step 2 when they click the back button to step 1. So it will still be there when they go forward and come to step 2 again.
Has anyone done that yet? if so how did you do it?
The back buttons work I just don't know how to save it to the session.
Maybe with a submit and redirect?
Any help appreciated :-)
Greetings
morphz​
M
morphz
Can't edit at the moment. That's my form:
http://farb-formulare.jdevcloud.com/formulare/auftragserfassung-reinigung​
GreyHead
Hi morphz,
You can do this with a second Submit button. After the form submits you need to process it as normal including the data save - then check to see which Submit button was clicked and redirect to the matching page.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
M
morphz
Thanks for the reply Bob
I am a bit confused.
#1. The submit buttons load the event I declare in the display section. Correct?
#2. As far I understand I add just one more event as target of all display sections where all the buttons and their matching redirectings are saved. Correct?​
​#3. What elements do I need to use in this event? How can I determine which submit button was clicked? php? or is there an easier way.
Thanks in advance!
GreyHead
Hi morphz,
1. Yes
2. I don't think so but I'm not sure what you are saying.
3. You can tell which button is clicked by checking the value which is submitted by the button element.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
M
morphz
I am not familiar with php. can you help me with the code?
Or am I approaching this wrong..
Thanks!
<?php​
​ $value1 = $_POST["button19"];​
​ $value2 = $_POST["button141"];​
​ ​
​ if ($value1 or $value2 == "Personalien") {​
​ header("Location: http://example.com/Page1.php");​
​ }​
​ if ($value1 or $value2 == "Adressen") {​
​ header("Location: http://example.com/Page3.php");​
​ }​
​?>