Hi
I am starting constructing a form using session variables for multiple
page data entry which works fine.
However I would like to add the facility of a 'SAVE AND RETURN' later
option.
So for example the user can start completing the form but can return at
a later date to complete the form before it is submitted.
What would be the best way to achieve this ?
My current form is shown below
TIA
<!--- Total Number of Steps in the Wizard --->
<cfset numberofsteps = 3>
<!--- The SESSION.app structure holds users entries --->
<!--- As they move through wizard. Make sure it exists! --->
<cfif not isdefined("SESSION.app")>
<!--- If the structure is undefined, create or initialize it
--->
<CFSET SESSION.app = structnew()>
<!--- The code below represents the users progress in the wizard
--->
<cfset SESSION.app.stepNum = 1>
<!--- We will collect these from the user; start as blank values
--->
<cfset SESSION.app.jobtitle = "">
<cfset SESSION.app.jobdesc = "">
<cfset SESSION.app.salary = "">
</cfif>
<!--- If user just submitted jobtitle, remember it --->
<!--- Do same for the directorID, Actors and so on --->
<cfif isDefined("FORM.jobtitle")>
<cfset SESSION.app.jobtitle = Form.jobtitle>
<cfset SESSION.app.jobdesc = Form.jobdesc>
<cfelseif isDefined("FORM.salary")>
<cfset SESSION.app.salary = Form.salary>
</cfif>
<!--- If user clicked the 'Back' button, go back a step --->
<cfif isDefined("FORM.goBack")>
<cfset SESSION.app.stepnum = URL.stepNum - 1>
<!--- However if the user clicked 'Next' go forward one --->
<cfelseif isDefined("FORM.goNext")>
<cfset SESSION.app.stepnum = URL.stepNum + 1>
<!--- If the user has finished, were complete --->
<cfelseif isDefined("FORM.goDone")>
<cflocation url="idvprocess.cfm">
</cfif>
<!--- END COLDFUSION LOGIC --->
<html>
<head><title>Test</title></head>
<body>
<!--- Show title and current step --->
<cfoutput>
<b>TEST FORM</b><br />
Step #SESSION.app.stepNum# of #numberofsteps# <br />
</cfoutput>
<cfform action="idv.cfm?StepNum=#session.app.StepNum#" method="POST">
<!--- Display the appropriate wizard step --->
<cfswitch expression="#session.app.stepNum#">
<!--- STEP 1 : Movie Title --->
<cfcase value="1">
<!--- Get potential film ratings from database ? --->
<!--- Show text entry field for title --->
Job Title<br>
<cfinput name="jobtitle" size="50" required="Yes" message="Please enter
a job title" value="#SESSION.app.jobtitle#">
<p>
What is the job description ?
</p><br />
<cfinput name="jobdesc" size="50" required="Yes" message="Please provide
the job description" value="#SESSION.app.jobdesc#">
</cfcase>
<cfcase value="2">
<cfinput name="salary" size="50" required="Yes" message="Please provide
the pitch text first" value="#SESSION.app.salary#">
</cfcase>
<cfcase value="3">
You have successfully finished the form
</cfcase>
</cfswitch>
<p>
<cfif SESSION.app.stepNum gt 1>
<INPUT type="submit" Name="goBack" value="<< Back">
</cfif>
<cfif SESSION.app.stepnum lt numberofSteps>
<INPUT type="submit" Name="goNext" value="Next >>">
<cfelse>
<INPUT type="submit" Name="goDone" value="Finish">
</cfif>
</cfform>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217338
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54