2 Replies Latest reply on Jul 5, 2006 1:45 AM by RyanG24

    holding form values

    RyanG24 Level 1
      Hi can someone help me i have a form at http://www.northsydneycc.com.au/selectteam.cfm what i need is when a user enters a name on the right of the page, this goes to my action page thenn returns back to the same page, i need to hold the values of the 11 list boxes, i.e if a user chooses player1, player2 and then realises that player3s name needs to be entered player1 and player2 hold the value once the new name has been entered.

        • 1. Re: holding form values
          Dan Bracuk Level 5
          On your first form submission, create session variables for each player selected. Then, do something like this:

          <cfoutput query="SelectNames">
          <option value="#SelectNames.ID#"
          <cfif id is session.id>selected="selected">
          >
          #selectNames.Surname#, #SelectNames.PlayerName#</option>
          </cfoutput>

          Make sure you do something the first time the page loads and your session variables don't exist yet.
          • 2. holding form values
            RyanG24 Level 1
            Hi i have tried the code below but i end up with nothing in my list

            any ideas what i am doing wrong?

            <cfif isdefined('form.YourTeam')>
            <cfset session.YourTeam=#form.YourTeam#><cfelse><cfset session.YourTeam="">
            </cfif>

            <select name="Player1">
            <cfoutput query="SelectNames">
            <option value="#SelectNames.ID#"
            <cfif id is session.id> selected="selected"></cfif>
            #selectNames.Surname#, #SelectNames.PlayerName#</option>
            </cfoutput>
            </select>