Also get rid of the evaluate and used named array convention for the form
field name, like:

<cfif listContainsNoCase(bannedWordsList, form[theField], ",")>
        blah

--
Tim Heald
[EMAIL PROTECTED]
703-300-3911
-----Original Message-----
From: Loathe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 21, 2006 7:50 PM
To: CF-Talk
Subject: RE: Keyword filter for contact form

Use listContains or listContainsNoCase.  listFind only matches the whole
string literal. 


--
Tim Heald
[EMAIL PROTECTED]
703-300-3911
-----Original Message-----
From: Mike | NZSolutions Ltd [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 21, 2006 7:16 PM
To: CF-Talk
Subject: Keyword filter for contact form

Hi guys,

I have the following filter for an email form...

<cfset bannedWordsList = "mike,little,good,bad"> (I have removed actuals so
this gets through.)

<cfif isDefined("FORM.fieldnames")>

        <cfloop index="thefield" list="#FORM.fieldnames#">
                <cfif listFindNoCase(bannedWordsList, evaluate('FORM.' &
thefield), ",")>
                        <cfset valid_email = 0>
                </cfif>
        </cfloop>

</cfif>

Now this works fine if for example the FORM.name = "mike", but not if the
FORM.name = "big mike".

What am I doing wrong.







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235933
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to