[thelist] Multi-Part Forms

Erik Mattheis gozz at gozz.com
Wed Jan 15 13:36:02 CST 2003


On Wednesday, January 15, 2003, at 01:18 PM, RUST Randal wrote:
> I have a 3-part form that, once it's filled out completely, places all
> of
> the values in the database.
> I want "builderAdd1.php" to post the data to itself and validate it
> there, so that any errors can be returned to the user at the field
> level.
> If all the values pass my validation scripts, then I want the page to
> move
> on to "builderAdd2.php."

The strategy I prefer for multi-page forms would be to validate
builderAdd1.php at the top of builderAdd2.php, and if it doesn't pass
validation, either a) cancel further processing of the page and display
an error message asking the user to use their back button, or b)
redirect back to builderAdd1.php with information in the query_string
to redisplay builderAdd1.php as you like.

> My not-so-good solution is to store the variables
> from screen 1 and 2 in the $_SESSION and then store them in the
> database all
> at once after the use clicks SUBMIT on the last screen.

You could also store the information from previous screens in hidden
form fields accomplish the same thing without having to rely on session
variables.

Just one of many ways to do it, I suppose, but it sounds like you're
looking for help with brainstorming. So there you go.
-  -  -  -  -  -  -  -  -  -  -
Erik Mattheis
(612) 377 2272
<http://goZz.com/>
-  -  -  -  -  -  -  -  -  -  -




More information about the thelist mailing list