Deana,

You're close.  The FORM scope itself is actually just one big structure,
which means you can copy it and pass it along.  You'll likely, however, need
to convert it to something that can be passed in the form hidden field - I'd
recommend WDDX.  Try something like this.

<!--- copy the form scope from the previous page submission --->
<cfset stcPage1 = structCopy(form)>
<!--- encode it as a WDDX packet --->
<cfwddx action="cfml2wddx" input="#stcPage1#" output="wstcPage1">
<!--- embed it in the form on page 2 --->
<cfoutput>
        <input type="hidden" name="stcPage1" value="#wstcPage2#">
</cfoutput>

This will pass the struct as a WDDX packet named wstPage1.  In order to
access the values of the struct on the next page, you'll need to
de-serialize it first, like this (this would be in the submit logic on page
2):

<cfwddx action="wddx2cfml" input="#form.wstcPage1#" output="stcPage1">

Then you should be able to reference fields from page one in the following
manner:

<cfoutput>
        #stcPage1.strFormField1#<br>
        #stcPage1.strFormField2#<br>
</cfoutput>

Hope this helps,
Tyson


-----Original Message-----
From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 10:38 AM
To: CF-Talk
Subject: fieldnames structure


Hi Folks,
I'm trying to figure out this structure thing, and I have a project where I
have to grab all the fieldname/value pairs from one form, hold them while
the user fills out a second page, then send them along in a hidden field to
the action page.

What's the best way to do this? I thought I could just do something like:
<input type="hidden" name="page1struct"
value="#structcopy(form.fieldnames)#"> But that throws an error.

-d



Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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