• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

holding form values

New Here ,
Jul 03, 2006 Jul 03, 2006

Copy link to clipboard

Copied

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.

TOPICS
Advanced techniques

Views

240

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 03, 2006 Jul 03, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2006 Jul 05, 2006

Copy link to clipboard

Copied

LATEST
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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation