I can think of two ways to check for empty items. First, CF9 added the
ability to notice them when converting them to an array. This isn't
the default, so if you compare, you can note the difference.

<cfset a = "1,2,,4">

<cfif arrayLen(listToArray(a)) neq arrayLen(listToArray(a,",",true))>
        You included empty items.
</cfif>

You can also just look for ,,

<cfif find(",,",a)>
        You included empty items.
</cfif>

As for looking for no apostrophes, just use the form of the FIND call above.
On Wed, Sep 21, 2011 at 6:10 AM, Akos Fortagh <akos.fort...@yahoo.com> wrote:
>
> hi there, just wondering if someone could help me out on this.
> 1. I need to make sure a user enters a simple but strict comma separated list 
> in a text box, looking out for duplicate commas like item1, item2,,item3
> Also make sure there's no apostrophes entered etc so the list must be like 
> item1,item2,item3
> 2. Each of these lists will go in a DB field for that particular user, and 
> then I need to pull out ALL lists of ALL users and make the individual lists 
> in to ONE huge long list again keeping the strict comma separation.  Each 
> individual list will probably end up without a comma on the end though.
>
> Not sure where to start..
> Any help would be appreciated...
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347551
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to