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: 3,882
Joined: 24-July 05
From: In Trouble Again... still?
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. Adding Flash Music Player To Home/any Page(4)
  2. Naming Web Page Files(5)
  3. PHP Function To Add Previous and Next Page Feature(0)
  4. Refresh Page After Back Button Hit(11)
  5. Need Help To Increase The Page Rank Of Website!(2)
  6. Scrolling Images?(5)
  7. How To Make An Item Scroll With You On The Page.(9)
  8. Page Load Error When Accessing Cpanel(0)
  9. Wap Source Code Viewer(4)
  10. How Do I Get Rid Of The Placeholder Page? [resolved](5)
  11. Create Page?(11)
  12. Open Php Page From Another Server(7)
  13. Php Unique Hit Counter(28)
  14. Refresh Web Page(6)
  15. Error Code In Subscriptions Page(5)
  1. Dreamweaver Or Front Page Or Other?(108)
  2. What Is Your Home Or Start Page?(14)
  3. Create A Google Seach Result Page Embed Within Your Site Page.(12)
  4. Html Page Not Showing Up In Firefox(1)
  5. Toggle display in page script(8)
  6. Multiple Page Titles(1)
  7. Web Page Tree Menu: Style Sheet - Javascript(5)
  8. I Cant Log In To Cpanel(6)
  9. Envizion's Front Page(12)
  10. Cpanel Demo Page(44)
  11. Web Page Layouts(1)
  12. Image Not Taking The Right Size In Web Page(1)
  13. Admin Page(4)
  14. Uk Users: Beware Of Phorm The Spy Your Isp May Adopt(3)
  15. Button To Print Current Web Page(13)


 



- Lo-Fi Version Time is now: 26th July 2008 - 08:05 AM