0
CFIF Contains question

/t5/coldfusion-discussions/cfif-contains-question/td-p/95084
Sep 12, 2008
Sep 12, 2008
Copy link to clipboard
Copied
How do I get the code below to work?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/cfif-contains-question/m-p/95085#M9358
Sep 12, 2008
Sep 12, 2008
Copy link to clipboard
Copied
PopcornCoder wrote:
> How do I get the code below to work?
>
> <cfset disco = "abis">
> <cfif #disco# CONTAINS "a">Yes<cfelseif>No</cfif>
> <cfif #disco# CONTAINS "l">Yes<cfelseif>No</cfif>
<cfif find(disco,'a')>YES<cfelse>NO</cfif>
OR (depending of if you care about case or not)
<cfif findNoCase(disco,'1')>YES<cfelse>NO</cfif>
> How do I get the code below to work?
>
> <cfset disco = "abis">
> <cfif #disco# CONTAINS "a">Yes<cfelseif>No</cfif>
> <cfif #disco# CONTAINS "l">Yes<cfelseif>No</cfif>
<cfif find(disco,'a')>YES<cfelse>NO</cfif>
OR (depending of if you care about case or not)
<cfif findNoCase(disco,'1')>YES<cfelse>NO</cfif>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/coldfusion-discussions/cfif-contains-question/m-p/95086#M9359
Sep 12, 2008
Sep 12, 2008
Copy link to clipboard
Copied
1. get rid of the octothorps in your cfif tag.
2. depending on what you are trying to accomplish, either replace the cfelseif tags with cfelse tags, or, put a condition inside those tags.
2. depending on what you are trying to accomplish, either replace the cfelseif tags with cfelse tags, or, put a condition inside those tags.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

