CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Help! Multi-page input form

Print topic Send  topic

Author Message
C.J. Cunningham
Posted: 05/10/2002, 8:14 PM

I want to collect information during registration and don't want to put all the fields on one form. e.g. The first page would collect name, address, phone, etc... then page 2 would collect preferences like personal interests, and page 3 would collect other info using drop down lists. How can I do this and still write to one record? Any ideas or examples?

Thanks,

C.J.
Brent
Posted: 05/10/2002, 9:53 PM

This is not easy, and by the time you're done, you may wish you never thought of it.<g>

As you undoubtedly discovered, when you move from one form to the next, you lose
the values that were entered (but not saved) on the previous form.

There are 2 ways around this problem, none of which are simple.

1) When you move to the next form, you will need to pass all fields either using
a Post, GET, or session variable. Then when the user presses Next on page 2, you
do the same thing with those fields too. Eventually you end up with all your fields
being passed from one form to the next. This isn't pretty.

2) When the person presses Next on Form1, you actually save the partial record
to a temporary table with that user's session id to indicate it belongs to him.
(The Next button is really the Save button and it moves to the next form.)
The second form instead of inserting the row, retrieves the row using the session#
so it edits the newly added temporary record (the user only sees the fields for
form2). You can pass the session# if you like, but I'd run an MD5() on it so it is
"encrypted" so someone else won't tweak it to call up someone else's information.

The Save button on the final form will save the final fields
into the temporary record, then copies the temporary record to the proper table.

Each row in the temporary table is date stamped, so the "Save" button after the record
has been copied to the correct table, will also look for records that are more than
1 day old and will delete them. This will clean up any aborted sessions.

Of the two solutions, I'd go for #2. You can have as many pages as you like
and as many fields as you like without doing a lot of coding.

Brent
C.J. Cunningham
Posted: 05/11/2002, 7:59 PM

I didn't know where to start and you gave me a nice map to follow. I appreciate your help.
test
Posted: 05/13/2002, 2:40 AM

test

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.