User Guide

434 CFML Language Reference
</OPTION>
</select>
</select>
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search Employee List">
</FORM>
<!--- wait to have a string for searching defined --->
<CFIF IsDefined("FORM.Submit") and IsDefined("FORM.departmentName")>
<CFSET myList = ValueList(SearchByDepartment.Department)>
<CFSET numberInDepartment = ListValueCountNoCase(myList,
FORM.departmentName)>
<CFIF numberInDepartment is 0>
<H3>There are no employees in <CFOUTPUT>#FORM.departmentName#</
CFOUTPUT></H3>
<CFELSEIf numberInDepartment is 1>
<CFOUTPUT>
<P>There is only one person in #FORM.departmentName#.
</CFOUTPUT>
<CFELSE>
<CFOUTPUT>
<P>There are #numberInDepartment# people in
#FORM.departmentName#.
</CFOUTPUT>
</CFIF>
</CFIF>
</BODY>
</HTML>