Ah, so the user is not required to go linearly through the form from step 1
to 2 to 3 but can jump around.  That does make it more challenging!

Then, I would probably lean toward a database and/or structure based
approach.  It's going to be more work, but that's what we get for allowing
users more flexibility.

You could design a table and/or structure that has each form element in it
and what page it goes on.  Then when a page is submitted you could write the
values to the table or structure, if the page is re-visited read the values
from the table or structure and populate the fields.

An small example of how a structure may look off the top of my head.

FormStruct['firstname'].page = 1
FromStruct['firstname'].value = "Ian Skinner"
FormStruct['FristJob'].page = 2
FormStruct['FirstJob'].value = "Country Club"

Hope that helps.

Ian Skinner
Web Programmer
Sierra Outdoor Recreation
www.SierraOutdoorReceation.com <http://www.SierraOutdoorReceation.com>

  _____

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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to