MultiPage Form in 1 page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

MultiPage Form in 1 page

Post by donny »

hello,

can anybody tell me how i can do multiple forms/form processing on 1 page. i look on some sites and their code has like 3/4 different forms in it but they all show up on the same page separately. like one after another. when you finish the first form it goes to the second and so on. is this done with php?
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: MultiPage Form in 1 page

Post by phphelpme »

Hi there.

You might want to check out this idea:

http://thecodeplayer.com/walkthrough/jq ... ogress-bar

This uses jquery to split the form up into what appear different forms but in reality, it just displays the one form in three different sections and all data is submitted together.

Hope this helps.

Best wishes
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: MultiPage Form in 1 page

Post by donny »

this is actually very cool. much nicer than what i was looking for. however the form i am making is a big order form so after one page of them typing out info i want it to show up on another page .. for example when they type in shipping info i need it to show up on a later page. if this is one big form i don't know how to show submitted information without processing it through a database?
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: MultiPage Form in 1 page

Post by phphelpme »

Hi there.

I personally would suggest either using PHP Sessions:

http://www.w3schools.com/php/php_sessions.asp

Or using some form of cookie:

http://www.w3schools.com/php/php_cookies.asp

Both of these options will allow you to create a form with a select amount of data, submit that to a PHP handling file, store the values in a session or cookie, transfer them to the second form using 'location' in PHP and then your form can use the previously entered details in the session or cookie to populate any form elements you need.

I hope this points you in the right direction.

Best wishes.
Post Reply