If I understand your problem,
1. you want to check for the existence of a variable
2. If the variable exists, then check against multiple values
3. display different HTML depending on value of variable
<cfif ParameterExists(someVariable)> <!--- check for var existence --->
<cfswitch expression="#someVariable#"> <!--- var exists, check for value --->
<cfcase value="1">
<img src="one.gif"> <!--- display HTML based on value --->
</cfcase>
<cfcase value="2">
<img src="two.gif">
</cfcase>
<cfcase value="3">
<img src="three.gif">
</cfcase>
<cfdefaultcase>
<img src="other.gif"> <!--- in case value wasn't in expected list --->
</cfdefaultcase>
</cfswitch>
</cfif>
CFSWITCH is much faster than multiple CFIF statements and you can always make
allowances for more and more cases as
need be.
HTH,
Adrian J. Moreno
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists