RE: JavaScript version of listContains()

2008-01-18 Thread Bobby Hartsfield
http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 12:16 PM To: CF-Talk Subject: SOT: JavaScript version of listContains() Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Charlie Griefer
On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED] wrote: that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. yeah, i thought about using subStr... but then you'd have to check for an optional comma in front and

SOT: JavaScript version of listContains()

2008-01-18 Thread Ian Skinner
Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can determine if a given value is one of four possible values. TIA Ian ~| Adobe® ColdFusion® 8 software 8 is the

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Ian Skinner
Claude Schneegans wrote: that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. Actually after thinking on this a bit it turned out to be fairly simple. At least for my immediate need of 6 possible 1 character values.

Re: JavaScript version of listContains()

2008-01-18 Thread Aaron Rouse
PROTECTED] Sent: Friday, January 18, 2008 12:16 PM To: CF-Talk Subject: SOT: JavaScript version of listContains() Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can determine if a given value is one of four possible values. TIA

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Qasim Rasheed
sorry, I responded too quick. This will actually be ListFind and not ListContains. On Jan 18, 2008 2:32 PM, Qasim Rasheed [EMAIL PROTECTED] wrote: I am hoping this will work function ListContains(list,item,delim){ var del = (delim == null)? ,: delim; return

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Qasim Rasheed
I am hoping this will work function ListContains(list,item,delim){ var del = (delim == null)? ,: delim; return list.split(del).indexOf(item) != -1; } On Jan 18, 2008 12:38 PM, Charlie Griefer [EMAIL PROTECTED] wrote: On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED] wrote:

RE: JavaScript version of listContains()

2008-01-18 Thread Jerry Guido
PROTECTED] Sent: Friday, January 18, 2008 12:16 PM To: CF-Talk Subject: SOT: JavaScript version of listContains() Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can determine if a given value is one of four possible values. TIA Ian

RE: JavaScript version of listContains()

2008-01-18 Thread Jerry Guido
received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 2:42 PM To: CF-Talk Subject: Re: JavaScript version of listContains

Re: JavaScript version of listContains()

2008-01-18 Thread Claude Schneegans
The guy from leftcorner.com (offline) ported a bunch of CF functions to JS. I still have a copy. Pretty handy. Pretty handy indead. Javascript looks like a retarded language when dealing with strings. Thanks. -- ___ REUSE CODE! Use custom tags; See

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Claude Schneegans
that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address:

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Charlie Griefer
i can't think of a simple, basic way off the top of my head. i'd probably end up doing a list.split(',') to convert the list to an array, then looping over the array to see if the element exists. that's not to say there's not a simple way tho. matter of fact, it's generally when i've gone ahead