How to preserve data in a Form in ColdFusion

cffrom - preserve data in coldfusion form

cfformPreserveData.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cffrom preservedata property: How to preserve data in coldfusion form</title>
</head>

<body>
<h2 style="color:DodgerBlue; font-style:italic">cfform example: preservedata property</h2>
<hr width="350" align="left" color="PaleVioletRed" />
<br />


<cfform name="testForm" method="post" preservedata="yes">
 <b>Name</b>
 <cfinput name="Name" type="text">
    <br />
 <b>Address</b>
    <cfinput name="Address" type="text">
    <br />
    <cfinput name="Submit" type="submit" value="Submit Data">
</cfform>

<h4 style="color:#F30;">
 <cfif IsDefined("Form.Submit")>
        <cfoutput>
            Your name: #Form.Name#
            <br />
            Address: #Form.Address#
        </cfoutput>
    </cfif>
</h4>
</body>
</html>













More ColdFusion examples