Pros and Cons of Form Filling

Posted: 1st July 2001 | Filed under: Press Articles, Technical
Author: Paul Ockenden

This article was originally published in PC Pro and is reproduced with permission.

A frequent query in the various scripting newsgroups concerns how to handle forms that are split over multiple pages.

Imagine a hundred-question form split over ten pages, which results in the production and emailing of a CSV file. What's the best way to handle this? You have three basic choices, the first being to use hidden form fields to pass the data from page to page. An obvious pro of this method is that it's very easy, but the cons are that it will slow down the site as data is continuously passed between server and browser and vice versa, and there's a bigger chance of mistakes. It will also make the system more difficult to maintain.

The second choice is to use session variables, which are supported by the majority of server-side scripting technologies. The main pro for this method is that, again, it's very easy to set up. The con is that if someone goes for lunch halfway through filling in their form, the session will time out and all of their data will be lost (and the chances of someone taking a break during a hundred-question form are high).

The third, and by far the best method, is to save each screenful in some kind of temporary store, probably a database of some description, and to use an id tag (via either GET or POST) to maintain a link to the correct temporary store. You'd clean the store out at the end of the process and have a regular housekeeping task that sweeps up data from any abandoned sessions. The pro here is that this is the most robust solution; the con is that it might take an extra half-hour to get working.

All articles Copyright CST Group Limited ©1997-2024

Let's Talk

Whether you have a new or existing project, we’d love to hear from you.

Our experienced team thrive on problem solving and working with your business goals in mind.

Get in touch

Cookie preferences

We'd like to know more about the pages you visit on our site to help improve it. If you're happy for us to collect this information please click accept all. Our full Privacy policy can be found here.