0

I want to use back button in my custom made form stepper. I have 3 steps and sending data from first step to second and from second to third (there is no option to skip from third to first etc.) and after third step I am saving data in DB (before not).

So I need solution how to use Back button on third step to get on second step with previous filled data. I have read similair topic (Back button re-submit form data ($_POST)) where answer is always -> use GET method.

In my case GET method isn't good solution because problem is that URL (Uniform Resource Locator) is limited on 2.083 characters and sometimes I send 100 chars in link but sometimes more than 3k.

Community
  • 1
  • 1
JohnWayne
  • 651
  • 9
  • 28
  • You want to use the browser's native back button? Or you want to build your own button that goes to the previous step? – showdev May 18 '17 at 20:06
  • I want to use my own button to get on previous step – JohnWayne May 19 '17 at 07:53
  • One method is to create an additional form consisting of hidden inputs to post the appropriate data back to the previous step. The submit button of that form would be your "Back" button. Another method is to use [session variables](http://stackoverflow.com/questions/9285944/navigating-back-to-to-first-form-without-losing-values). I'd say the suitability of each solution depends on the context of your specific project. – showdev May 19 '17 at 16:45

1 Answers1

0

For multi step forms you can always use javascript / Jquery to do the task for you. simple example here

rahul singh
  • 451
  • 1
  • 3
  • 17
  • thx for replying but I am working on existing stepper in php and few systems accessing on it - one from step 1 another from step 2 and other comination so I am trying to find quick solution - I will try to with sessions. – JohnWayne May 18 '17 at 06:14