Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Holding values from a page to the next

 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all I have run into a slight issue creating one of my pages. I am trying to make a page that allows users to work their way through multiple levels in a tree structure. I have managed to get the code to almost work. The only issue being that I lose the value of the references that were made before the current one. To explain:
My tree can go to a possible 7 levels deep. Each level has 5 choices. The first level is always displayed on the screen (it's placed there when the form is created. The next level values will be determined based on which of the first level values is selected. When this happens I want show the first level as well as all the results that are below the choice from the first level. Then when the choose one from the second level I want to add on the third level values that are below the second level value that was selected.

My big issue is I haven't figured out a way to keep each of the variables around once they have been choosen. The only thing that I can think of is to throw them into session. Is there any other thoughts or manners in which to accomplish this ?

thanks in advance.

Sorry if this is run-on. Not sure how else to describe it.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the user selects a level are you submitting a form? If so then probably the easiest way to keep the values is to store them in hidden fields using the html:hidden tag. They way all the parent values will be submitted along with the current selection.

- Brent
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brent Sterling:
When the user selects a level are you submitting a form? If so then probably the easiest way to keep the values is to store them in hidden fields using the html:hidden tag. They way all the parent values will be submitted along with the current selection.

- Brent


I had thought about that, but for some reason I thought the hidden fields would be cleaned up everytime.

thanks for the suggestion.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A hidden field works pretty much just like a text field...well except it is hidden so the user cannot edit the value. When the page is loaded the hidden fields are populated with the values from your form and when the page is submitted the values of the hidden fields are submitted as well. During development you can try using html:text field to make it easier to see the values.

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic