Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Passing Variables Through A Page?
kvarnerexpress
post Feb 7 2006, 08:22 PM
Post #1


Super Member
*********

Group: Members
Posts: 407
Joined: 13-December 04
Member No.: 2,696



I have a form that people fill out. Depending on what they fill out on that form, they get different things on the page they're taken to after hitting "submit". Information from both pages goes into a database.

However, I don't want to create a new row until the second page has been filled out and submitted (taking the user to a third page). Is there any easy way to pass all the variables from the first page through the second and to the third? I know I can stick it all in hidden inputs, but I have more than 60 form items to process, and I'd like to not have to code an entire page just to pass them as possible.
Go to the top of the page
 
+Quote Post
Paul Thomas
post Feb 17 2006, 04:13 AM
Post #2


Newbie
*

Group: Members
Posts: 2
Joined: 17-February 06
Member No.: 18,736



QUOTE(kvarnerexpress @ Feb 7 2006, 02:22 PM) *

I have a form that people fill out. Depending on what they fill out on that form, they get different things on the page they're taken to after hitting "submit". Information from both pages goes into a database.

However, I don't want to create a new row until the second page has been filled out and submitted (taking the user to a third page). Is there any easy way to pass all the variables from the first page through the second and to the third? I know I can stick it all in hidden inputs, but I have more than 60 form items to process, and I'd like to not have to code an entire page just to pass them as possible.


Well if you have 60 items to collect, you are going to have to track 60 items page to page unless you do some interim database solution in between. One idea that might make it easier would be to name you Form UI objects according to some pattern: txtBox1, txtBox2, txtBox3 and then write a cfloop to go over them...then instead of writing 60 hidden inputs to maintain you would have something more manageable.

I suppose you could also do session variables but that might put more wear-n-tear on your server then you want.

Thougts?
Go to the top of the page
 
+Quote Post
sharpz
post Feb 17 2006, 05:21 AM
Post #3


Member [Level 1]
****

Group: Members
Posts: 67
Joined: 16-November 05
Member No.: 14,373



QUOTE(Paul Thomas @ Feb 16 2006, 08:13 PM) *

Well if you have 60 items to collect, you are going to have to track 60 items page to page unless you do some interim database solution in between. One idea that might make it easier would be to name you Form UI objects according to some pattern: txtBox1, txtBox2, txtBox3 and then write a cfloop to go over them...then instead of writing 60 hidden inputs to maintain you would have something more manageable.

I suppose you could also do session variables but that might put more wear-n-tear on your server then you want.

Thougts?


Isnt there the equivalent of a cookie in CF? If there is there should be no reason to track all 60 items within each page. Im sure theres a way you can create session variables.
Go to the top of the page
 
+Quote Post
jlhaslip
post Feb 17 2006, 07:41 AM
Post #4


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,077
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



One possible solution might be to place the items from the first page in to an array and then write the array to a temp database, passing only a row id number before handling the second page, storing the second page info into a second array, then read the first array back and concatenating the two arrays before writing to the db? A bit of a struggle, but if you can code it like suggested above so that the data handling can be looped by an index, it probably wouldn't be so bad.
Go to the top of the page
 
+Quote Post
Paul Thomas
post Feb 19 2006, 02:56 AM
Post #5


Newbie
*

Group: Members
Posts: 2
Joined: 17-February 06
Member No.: 18,736



QUOTE(sharpz @ Feb 16 2006, 11:21 PM) *

Isnt there the equivalent of a cookie in CF? If there is there should be no reason to track all 60 items within each page. Im sure theres a way you can create session variables.


ColdFusion does have a <cfcookie> tag but why store all the values as cookies...it would be easier and probably efficient to use the an html input field or cfinput field instead. Cookies would only come in handy if you were trying to ease the users data entry if they were visiting your site / pages on a reoccuring basis.

smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Help In Ipb 2.1.6 Portal Page(1)
  2. PHP Function To Add Previous and Next Page Feature(5)
  3. I Can't Find The Password Reset Page... [resolved](5)
  4. Cant Log Into Cpanel [resolved](11)
  5. My Ro Page(4)
  6. Plot Page Help Invisionfree(0)
  7. How To Make An Item Scroll With You On The Page.(10)
  8. Page Load Error When Trying To Get Into Control Panel(2)
  9. Button To Print Current Web Page(14)
  10. Php Unique Hit Counter(29)
  11. Problem With Page Redirect(8)
  12. Php Linking(2)
  13. Web Page Designing(5)
  14. Google To Take On Geocities(53)
  15. Redirecting Visitors To Different Page(8)
  1. How To Implement A Date Picker On A Web Page(0)
  2. What Is Your Home Or Start Page?(19)
  3. Google Page Creator Updated(4)
  4. Naming Web Page Files(9)
  5. Adding Flash Music Player To Home/any Page(4)
  6. Web Page Tree Menu: Style Sheet - Javascript(6)
  7. Refresh Page After Back Button Hit(11)
  8. Need Help To Increase The Page Rank Of Website!(2)
  9. Scrolling Images?(5)
  10. Page Load Error When Accessing Cpanel(0)
  11. Wap Source Code Viewer(4)
  12. How Do I Get Rid Of The Placeholder Page? [resolved](5)
  13. Create Page?(11)
  14. Open Php Page From Another Server(7)
  15. Refresh Web Page(6)


 



- Lo-Fi Version Time is now: 8th October 2008 - 10:05 AM