magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1999 > 08 > Programming with Perl

Handling Multipage Forms

Handling forms with the all-singing, all-dancing CGI.pm module is not a difficult task. Just toss up a Web page with the right form elements, add a submit button, then wait for the reply, and call param to get the data.

But what if the form is too long to fit comfortably on one page? How can we make sure visitors are able to get to all the pages to complete the requested information? How can we let visitors keep clicking on "next page" until they've finished entering all of the numerous items we've asked them to fill out? And worse yet, those darned users sometimes make mistakes, and want to back up!

Well, one easy technique is to use client-side storage, in the form of hidden fields. The main advantage is that we get this storage for free (think of it as extremely distributed memory). The downside is that people can (and will) hack the data, leading to potential security issues if you don't protect against that. Also, if there are many fields to fill out, it's gonna be potentially painful on a slow data link as the same values get passed repeatedly between the browser and the server. The program I present here does not directly address these shortcomings, but this should be OK for most noncritical uses.

But to use hidden fields, you have to generate them. The mess of trying to determine which hidden fields to send out -- and then setting up all those individual forms -- might seem a bit daunting, unless you get Perl to help out.

Hidden Opinions

Let's look at a typical multipage form application: a "how did we do?" survey.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2