Hidden Form Fields Example

I’m going to use a very simple example to illustrate how hidden form fields can be used to preserve client state from one form to the next in a multiple form application. This example is simplified by leaving out all form validation code, and by using very few form fields.

If form validation was included, the application would have to verify that the user input in each stage of the application was valid before moving on to the next form. Adding more form fields is easy—you just have to determine which form to place them in, and be sure that you replicate them in each following form using hidden form fields.

In this ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.