You're going to have two options.

1) Use session variables.  On the action for each page loop over
FORM.fieldnames and append those fields and values to your
session.st5stepProcess - Sessions are the easiest, but they and locking
are avoidable if you want to try the next method.

2) Use WDDX.  The trick with using WDDX in this fashion is that you're
going to end up with WDDX inside other WDDX.  The first pages info will
be inside a field of the second pages WDDX fields, the second inside the
third and so on.  So you'll need to convert the WDDX using the
xmlformat() function.  If you try to deserialize a WDDX packet with
another inside you'll get an error.  The progression is like this

First page -
Your normal form

In the second page -
<cfwddx action="CFML2WDDX" input="#FORM#" output="wstPage1">

<form>
<input type="hidden" name="wstPage1" value="#wstPage1#">

In the third page - the part where you have to start paying attention
<cfset FORM.wstPage1 = xmlformat(FORM.wstPage1)> <!--- now all the < are
&lt; etc... --->
<cfwddx action="CFML2WDDX" input="#FORM#" output="wstPage2">
<form>
<input type="hidden" name="wstPage2" value="#wstPage2#">

Then when you want to pull it all out
<cfwddx action="WDDX2CFML" input="#FORM.wstPage2#"
output="variables.wstPage2">
<cfwddx action="WDDX2CFML" input="#variables.wstPage2.wstPage1#"
output="variables.wstPage1">

This will then give you a couple of different structs to play with that
then contain all your data.

I haven't pushed it past three pages, but I'm pretty sure if you keep up
the progression of WDDX and xmlformat it will keep working.

I ended up using CFDUMP quite a bit to make sure things were getting
passed properly.  It'll help a great deal.

HTH,

t

**********************************************************************
Tyler M. Fitch
Certified Advanced ColdFusion 5 Developer

ISITE Design, Inc.
615 SW Broadway Ste. 200
Portland, OR 97205

503.221.9860 ext. 111
http://isitedesign.com
**********************************************************************



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 14, 2001 9:50 AM
To: CF-Talk
Subject: Passing form field data


Hi, 
 
I have a very long form which i have broken down into 5 pages. My
question is what's the best way to store and pass form fields from each
page to the last page where all field data will be sent to a database.
 
thanks
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to