Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create and append form fields to a array session

Status
Not open for further replies.

8ginga8

Programmer
Dec 14, 2004
54
CA
hope someone can help,

I have a form that I split into 6 sections because it is very long so what I need to do is when someone fills out the first part and hits submit I need it submited to a session that will hold it for later use and when they fill out the second and so on I need them added to the array. does any one have any ideas on how i might go about this. I know that I should be using arrays and sessions. but not sure exactly how.
 
No, you shouldn't be using arrays or sessions, you should be using hidden form fields.

The following code will take all values entered on the previous form page and save them as hidden values on the current form page.
Code:
<cfoutput>
  <cfloop list="#form.fieldnames#" index="f">
    <input type="hidden" value="#jsstringformat(FORM[f])#" name="#f#">
  </cfloop>
</cfoutput>
Copy the above code and paste it in each one of your forms (except the first page) and it will keep passing all form values to the last page.



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top