Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion if statement syntax

Status
Not open for further replies.

miagriff

Technical User
Dec 11, 2015
1
0
0
US
I am working with some legacy code and I am stuck on evaluating a ColdFusion if statement with multiple conditions. What I am looking to do is this:

<cfif condtion1 eq'yes'>
Display this text
</cfif>

<cfif condition2 eq'yes' && condition1 eq'no'>
display different text
</cfif>

<cfif condition2 eq'yes' && condition1 eq'yes'>
display same text as second if statement
</cfif>
If the first statement is true, it functions properly. If the second statement is true, if functions properly.

If the third statement is true, it is displaying the text from the first statement when it should be displaying the text from the second statement.
 
Code:
<cfif condtion1 eq 'yes' And condition2 eq 'no'>
Display this text
</cfif>

<cfif condition2 eq 'yes' [s]&&[/s]And condition1 eq 'no'>
display different text
</cfif>

<cfif condition2 eq 'yes' [s]&&[/s]And condition1 eq 'yes'>
display same text as second if statement
</cfif>


Lyndon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top