Actually I just had a bit of inspiration that might work. You could try
using a naming convention...
On the action page of page 1 (page 2 or something in between).
<cfoutput>
<cfloop list="form.fieldnames" index="field">
<cfif field NEQ "fieldnames"><!--- don't want to double these up --->
<input type="hidden" name="pg1#field#" value="#form[field]#">
</cfif>
</cfloop>
</cfoutput>
And on the action page for page 2...
<cfoutput>
<cfloop list="form.fieldnames" index="field">
<cfif field NEQ "fieldnames"><!--- don't want to double these up --->
<input type="hidden" name="pg2#field#" value="#form[field]#">
</cfif>
</cfloop>
</cfoutput>
This could give you a handle that you can check against when you are
creating the hidden fields...there will be a fair amount of checking you may
want to do, so it will take some tweaking (checking and string parsing).
You would want to be careful so you don't start getting fieldnames like
pg1pg1pg1FirstName or pg2pg1pg2Zip. But that should get you a start.
_____
I've stopped 18,249 spam messages. You can too!
One month FREE spam protection at http://www.cloudmark.com/spamnetsig/}
-----Original Message-----
From: Suyer, Ed [PRD Non-J&J] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 4:08 PM
To: CF-Talk
Subject: RE: multipart form - passing fields
Thanks! This helps.
RE:
<cfoutput>
<cfloop list="form.fieldnames" index="field">
<cfif field NEQ "fieldnames"><!--- don't want to double these up --->
<input type="hidden" name="#field#" value="#form[field]#">
</cfif>
</cfloop>
</cfoutput>.
There appears to be one other exception. I also have to account for the
fields that exist on the current form. In otherwords, If I start on step 1,
got to step 3, then come back to step 1, fieldnames = <all form fields on
form 3> & <all fields on form 1>. So when looping through, I'll need to
maintain a list of the fields on the current form. Otherwise I'd get
duplicate form fields.
I wonder if it's possible to do the entire thing in a JS + CF combination at
the end of the form and dynically create hidden form fields? This would
eliminate any need to hard code the names of the fields on the current form.
RE: I'd skip the hidden form fields, and after each step store the data in a
struct in the session scope.
So would an input field look like so <input name="firstname"
value="#session.formdata.firstname#"> ?
Or is there some sort of mapping that goes on?
It seems with this approach, you'd still need to know up front all the
fields on the form to initialize the struct. Or am I missing something?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4