<cfelseif>

Use this tag within <cfif> tags and optionally, together with other <cfelseif> tags and a final <cfelse>.

<cfelseif> lets you create compound conditional statements in CFML.

The <cfelseif> tag will handle cases not handled by the original <cfif> or preceding <cfelseif> tags.

The value in the <cfelseif> tag can be any expression.

This tag cannot have a body.

This tag is also supported within <cfscript>

<cfelseif #boolean condition#>
Attribute Description
condition
boolean, optional

Expression condition

Examples

Tag format

<cfif isArray(SERVER)>
	<cfset result="It is in Array format">
<cfelseif(isStruct(SERVER))>
	<cfset result="It is in Structure format">
<cfelse>
	<cfset result ="Other than struct & Array">
</cfif>
<cfdump var="#result#" />

Script format

//script format
	numb=1
	if(numb gt 1){
		writeOutput("It is greater than 1 ");
	}else if(numb eq 1){
		writeOutput("It is equal to 1 ");
	}else{
		writeOutput("It is not greater than or equal to 1 ");
	}

See also