list find?
I have a form with mutiple text fields for user to enter email addresses. I don't want them to enter the duplicate emails so created two lists here
Existing_EmailList: list all emails in the table.
Current_EmailList: all from the form (included from table and new email just enter)
I've tried to do ListContains, and Listfind but none of them work. Can you help?
<cfset Existing_EmailList = valuelist(getCurrentEmail.email, ',') />
test@test.com, yes@yes.com, no@no.com
<cfset Current_EmailList = arguments.email />
test@test.com, yes@yes.com, no@no.com,no@no.com,one@one.com
<!---<cfif ListContains(Existing_EmailList, #Current_EmailList#)>--->
<cfif Listfind(Existing_EmailList, #Current_EmailList#)>
<cfset duplicate = true>
<cfelse>
<cfset duplicate = false>
</cfif>
Thanks
