CFMX v6.1 I'm trying to put together code that presents the user with selection options. The first page presents radio buttons and drop down menus. The user makes radio and drop down selection then clicks "next" button for the next series of selections on the next page.
I'm using a structure to save selections to session vars. Problem: I want functionality such that, if user clicks "back" button to make changes he/she is presented with original/preselected options. The code below works for the radio options, but I don't know how to pull it off with the drop down options. I've trimmed down a lot of the selection options from page one of my code. The second page outputs the session vars so I know they are being set. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>Untitled Document</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> </HEAD> <!--- join.cfm ---> <!---total number of steps in the wizard---> <CFSET NumberOfSteps = 2> <!--- the session structure stores users entries ---> <!--- as they move through wizard. make sure it exists ---> <CFIF NOT IsDefined("SESSION.newreg")> <!---if the structure is undefined, create/initialize it ---> <CFSET SESSION.newreg = StructNew()> <!--- this represents the current wizard step; start at one ---> <CFSET SESSION.newreg.StepNum = 1> <!--- we will collect these from user; start at blank ---> <CFSET SESSION.newreg.dept = ""> <CFSET SESSION.newreg.month = ""> </CFIF> <!--- if user submitted information, remember it ---> <CFIF IsDefined("FORM._month")> <CFSET SESSION.newreg.dept = FORM._dept> <CFSET SESSION.newreg.month = FORM._month> </CFIF> <!--- if the user clicked the Back button, go back a step ---> <CFIF IsDefined("FORM.GoBack")> <CFSET SESSION.newreg.StepNum = URL.StepNum - 1> <!--- if user clicked Next button, go forward one ---> <CFELSEIF IsDefined("FORM.GoNext")> <CFSET SESSION.newreg.StepNum = URL.StepNum + 1> <!--- if user clicked "Finished" button, we're done ---> <CFELSEIF IsDefined("FORM.GoDone")> <CFLOCATION URL="JOINCOMMIT.cfm"> </CFIF> <CFSET location = "Marketing,Sales,Administration,Technical"> <body> <!--- data entry form, which submits back to itself ---> <CFFORM ACTION="vartest.cfm?StepNum=#SESSION.newreg.StepNum#" NAME="Reg" METHOD="POST"> <!--- display appropriate wizard stepnum ---> <CFSWITCH EXPRESSION="#SESSION.newreg.StepNum#"> <!--- step one, gather personal info ---> <CFCASE VALUE="1"> <!--- get user department info ---> <TABLE ALIGN="CENTER" WIDTH="100%"> <TR> <TD> <CFLOOP LIST="#location#" INDEX="i"> <CFSET IsChecked = i EQ SESSION.newreg.dept> <CFINPUT TYPE="RADIO" NAME="_dept" CHECKED="#IsChecked#" VALUE="#i#"> <CFOUTPUT>#i#</CFOUTPUT> </CFLOOP> </TD> </TR> <TR> <TD> <CFSELECT VALUE="#SESSION.newreg.month#" NAME="_month" SELECTED="Ischecked"> <OPTION VALUE="January">January <OPTION VALUE="February">February <OPTION VALUE="March">March <OPTION VALUE="April">April <OPTION VALUE="May">May <OPTION VALUE="June">June <OPTION VALUE="July">July <OPTION VALUE="August">August <OPTION VALUE="September">September <OPTION VALUE="October">October <OPTION VALUE="November">November <OPTION VALUE="December">December </CFSELECT> </TD> </TR> </TABLE> </CFCASE> <CFCASE VALUE="2"><CFOUTPUT> #SESSION.newreg.dept#<br> #SESSION.newreg.month#<br> </CFOUTPUT></CFCASE> </CFSWITCH> <CFIF SESSION.newreg.StepNum GT 1> <INPUT TYPE="Submit" NAME="GoBack" VALUE="<< Back"> </CFIF> <cfif SESSION.newreg.StepNum LT NumberOfSteps> <INPUT TYPE="SUBMIT" NAME="GoNext" VALUE="Next >>"> <CFELSE> <INPUT TYPE="SUBMIT" NAME="GoDone" VALUE="Finish"> </cfif> </cfform> </BODY> </HTML> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2920 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
