Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
You'll need to use Sessions or AJAX to pull this off. There's tons out there on multi-step forms using both methods, it's a common problem and a good one to solve on your own steam! 👍🏻
-
octacian718y@pixeltherapy I got it fully working by adding a final else to use the "action" index when including (that's if there is an error message of course). This only works because my form sets step to 2 (for example), and action to 1. This indicates that the next page is 2, but the information was submitted from page 1 (so that if there are errors, page 1 cab be included instead of 2).
Sessions and AJAX are things I'm currently learning about, but for now it seems this works OK. -
Once you get the hang of ajax I'd definitely try to rewrite it, since that would make it look smoother than loading a new page everytime. But anyway good job on figuring it out :) That's a whole new level of rubber duck debugging
-
@octacian fair play! :) There are huge improvements you could make to this, but getting it working is the first step on that road. 👍🏻
Look into sessions first as it will serve you well, even if you never use them again. AJAX is awesome but can take a little more effort to get to grips with.
Good job! 😊
Related Rants
The hardest thing about writing code that works can be logic. For example, figuring out how to say you want to go to the next page when the form submit button is pressed, but not actually move to the next step is an error was thrown during processing.
This is one of those times when. I force a random member of my family to sit there and listen to me talking, pretty much to myself, until I figure it out. But hey, it generally turns out pretty good! (If not my energetic nephew)
undefined
logic
if
php