ColdFusion IIF() - How to use IIF function

IIF() function

IIF.cfm


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IIF function example: how to use IIF function in coldfusion</title>
</head>

<body>
<h2 style="color:Crimson">IIF Function Example</h2>
<cfset DefaultColor="HotPink">

<cfoutput>
<b>Default Color</b>:
#IIF(IsDefined("DefaultColor"),DE(DefaultColor),DE("Green") )#
</cfoutput>
</body>
</html>





More ColdFusion examples