Multipage Form using hidden fields, session variables or custom database storage.

Posted on 2005-02-24
Medium Priority
Last Modified: 2012-06-21
I have designed a multipage form using session, but I concern about its performance as I have nearly 100 fields (6 pages) to remember.

I think it is 3 possible ways to make multiple page form.
1. Hidden fields, all form inputs are generated and send along on each page form but show only those for that page.
2. Session variables, store predefined field in session variables. Again all varibles are sent along with page but less than first case as my multipage form is sequential (user can only back/forward/cancel).
3. Custom database storage. Just store each page variables in database and load them page by page. We need garbage collection here. As I have cancel button this provide me to do garbage collection, and I have also update time to check its heartbeat for particular request. I think this is the BEST SOLUTION.

Please give me any suggestion or comment.

Question by:soapsiam
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 25

Accepted Solution

Marcus Bointon earned 400 total points
ID: 13401256
You missed the fourth, and most efficient mechanism: Build the whole thing as one big form and use javascript and CSS to split it into multiple pages. A really good example of this is in the mambo admin interface which you can play with here:


Log into the admin area (it's down right now). The tabs for different settings are all divs on one big form - it has maybe 12 pages, all handled as one form, and you will notice that it's extremely responsive - no delay or refresh when switching between pages. Also there's no trouble with trashing incomplete forms as incomplete forms are never submitted.

More examples here:

The PEAR quickform library also has built-in support for server-side multipage forms: http://pear.php.net/package/HTML_QuickForm_Controller

Author Comment

ID: 13409846

Did you ever try PEAR HTML_QuickForm_Controller? What is it based on?
LVL 25

Expert Comment

by:Marcus Bointon
ID: 13620202
I've not used QuickForm controller - it's based on QuickForm! Because it's pear, it's all just straight PHP. I do find some of the pear stuff a bit obtuse ;^)

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question