Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ColdFusion compare variable to a list - cfif statement

Posted on 2009-04-08
2
527 Views
Last Modified: 2012-05-07
Hi, I have a variable that I want to compare to a list, and if it matches on of the values, then I want to display something.  I don't remember the right way to do this.

Basically, I want this:

<CFIF #value# in (1,2,3)>go</cfif>
0
Comment
Question by:wkolasa
2 Comments
 
LVL 19

Accepted Solution

by:
erikTsomik earned 500 total points
ID: 24097975
try this
<cfset lList="1,2,3">
<cfif ListFindNoCase(lList,value) gt 0>
go
</cfif>
0
 

Author Closing Comment

by:wkolasa
ID: 31597481
Thank you.  Solution worked just as I needed.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question