Actually building our your suggestion, you should be able to do something
like this:  (completely off the top of my head and untested, but hopefully
it helps).

At the top of a page 2-5:

<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>.

This should copy all form elements from the previous form into hidden fields
on the new form, keep doing this step by step and you will have one giant
form by the end.

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA


-----Original Message-----
From: Scott Weikert [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 2:40 PM
To: CF-Talk
Subject: Re: multipart form - passing fields


>To me this seems like a pretty common type of interface.  And I'm hoping
>there's some people on this list that have built something like this before
>.... what I want to know is this -> is there a mechanism to pass form
fields
>from one form to another w/o hard coding the form field names?  I'm sure my
>boss is going to want me to add more fields someday ... and I'd like to be
>able to do this w/o changing too many things.

There's a form field that gets passed called "fieldnames", I believe, that 
is a comma-delimited list of all the fieldnames passed from the previous
form.

If you know, on each page, what field names you're using on THAT form - you 
could compare that list of fields to form.fieldnames, and any non-matches, 
create a hidden field var for.

Trick with this is, you'd pretty much have to have the lists of field names 
for each form bit - if you're pulling stuff out of a DB, then you could 
build up the list easy enough. Otherwise, you'd have to maintain a list 
variable of fieldnames for each form section. Only one spot though, so 
adjusting would be cake. 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to