How to use CFselect in ColdFusion XML format form

cfselect in xml format form

cfselectXmlForm.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ColdFusion cfselect tag example: how to use cfselect in xml format form</title>
</head>

<body>
<h2 style="color:DodgerBlue">cfselect example: Xml Format Form</h2>
<cfif IsDefined("Form.Submit")>
 You selected Employee: <cfoutput><b>#Form.Employee#</b></cfoutput>
    <br /><br />
</cfif>

<cfquery name="qEmployee" datasource="cfdocexamples">
 SELECT LastName FROM Employee
</cfquery>

<cfform name="SelectTestForm" format="xml" skin="beige" method="post">
    <cfselect 
        name="Employee" 
        query="qEmployee" 
        display="LastName" 
        label="Employee"
        >
    </cfselect>
    <cfinput type="submit" name="Submit" value="Submit">
</cfform>
</body>
</html>





More ColdFusion examples