Looks like you need ListFind(), not ListContains().

ListFind looks at the entire element, while ListContains looks at
substrings.

<cfset myList="21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6">

ListFind(myList,7) will return 15

ListContains(myList,7) will return 5 (which is the element 17)


--- Stuart Kidd <[EMAIL PROTECTED]> wrote:

> Hi guys,
> 
> I'm having problems with lists.
> 
> I displayed a list of all article titles (and IDs) that could relate to
> a
> specific title and the user can select which ones can be links (via a
> select
> form).
> 
> That part is all good and it inserts the comma separated list into the
> field
> articleRelatedLinks (something like 37, 76, 84, 99).
> 
> Then when I would like the user to be able to update the form is when I
> have
> the problem.
> 
> The problem I'm having below is that it only seems to select the first
> number in the list - it doesn't see it as a list but one field.
> 
>  <p>Article Related Links<br>
> 
>   <select name="articleRelatedLinks" multiple size="4">
> 
>  <cfoutput query="showTitles">
> 
>   <option value="#showTitles.articleID#" <cfif
> ListContains(showArticle.articleRelatedLinks,
>
showTitles.articleID)>selected</cfif>>#showTitles.articleTitle#</option>
> 
>  </cfoutput>
> 
>   </select>
> 
>  </p>
> 
> Is there a way I can loop it through the list or am I going around it
> the
> wrong way.
> 
> Any help will be appreciated.
> 
> Thanks,
> 
> Saturday.
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184340
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