How to use CFselect with multiple selection mode in ColdFusion

cfselect - multiple selection mode

cfselectMultiple.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 with multiple selection mode</title>
</head>

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

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

<cfform name="SelectTestForm" method="post" action="">
 <cfselect 
     name="Employee" 
        query="qEmployee" 
        display="FirstName" 
        multiple="yes" 
        required="yes"
        message="Select one" 
        >
    </cfselect>
    <br /><br />
    <cfinput type="submit" name="Submit" value="Submit Employee">
</cfform>
</body>
</html>













More ColdFusion examples