I have two forms. In form1 both name and address must be entered. If one of these entries are missing, an error message is displayed after doing server side validation. If no errors, the results entered in form1 should be displayed in form2. I executed CFLOCATION after successful validation, but the data entered in form1 are not passed to form2. I get the message txtName and txtAddress are undefined in form (2). How can I pass data from the first screen screen to another after server side validation was successful? Any suggestion is highly appreciated. Below please find my code
Form1
<cfif isDefined("form.btnSubmit")>
<cfif len(trim(#form.txtName#)) GT 0 and len(trim(#form.txtAddress#)) GT 0>>
<cflocation url="form2.cfm" addtoken="true">
<cfelse>
<H3>Name and address must be entered</H2>
</cfif>
</cfif>
<cfform action="form1.cfm" method="post">
User ID:<cfinput type="Text" name="txtName"><br>
Phone: <cfinput type="Text" name="txtAddress"><br>
<cfinput type="submit" name="btnSubmit" value="Validate"><br>
</cfform>
Form2
<H2>You made the following entries </H2>
<p> Name: <cfoutput>#form.txtName#</cfoutput></p>
<p> Address: <cfoutput>#form.txtAddress#</cfoutput></p>