[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Question on my CF IF Statement?

Experts,

I have this CFIF statement and it is not displaying/finding the "EV" grp and the "EVENTS" name from the query.
I am thinking that there is something wrong with how I have coded the CFIF statement.

Basically, I am trying to output the two grp (groups) "DT" and "EV".
I have several grp (groups) identified in the table, and I want to show the "EV" grp with the "DT" grp only.

Can someone take a look at my code?

///////////////////////////////////////////////////////////////////////////
<cfelseif Trim(grp) is "DT" or Trim(grp) is "EV">
<cfif IsDefined("Cookie.adminID_cmcal2")>
<a href="caledit.cfm?RecordID=#id#&Direction=#url.direction#" title="#eventdescription#">
<FONT FACE=ARIAL color="green" size="-2">#name#-<i>#reasonout#</i></A></FONT><br>
<cfelse>
<cfif name IS "EVENTS">
<FONT FACE=ARIAL color="green" size="-2"><a href="##" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">HOLIDAY</a></i></FONT><br>
<CFELSE>
<FONT FACE=ARIAL color="green" size="-2">#name#-<i>#reasonout#</i></FONT><br>
</cfif>
</cfif>
///////////////////////////////////////////////////////////////////////////
0
g118481
Asked:
g118481
1 Solution
 
incapitalCommented:
You don't have end tags for all your <cfif> tags. I'm assuming that this is just an excerpt, and that that's not the cause of yoru problem.

First off, I would try just outputting the value you're trying to examine:

<cfoutput>#trim(grp)#</cfoutput>

If you're not getting inside that elseif block, then your condition isn't evaluating to 'true'. Take a look at the data and make sure that you're getting that values you expect there.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now