hi,

I am dynamically populating a select box.
I would like to have some items already selected, but I would like these to
appear at the top of the list.

I have a select box that is populated from a query from the categoryname
table
<CFQUERY name="category" datasource="#dsn#" dbtype="ODBC">
 SELECT categoryID, categoryName
 FROM categoryName
</CFQUERY>

<select name="categoryID" size="6" multiple class="searchText">
<cfloop query="category">
 <option value="#categoryID#"<cfif ListFind(catlist, "#categoryID#")>
selected</cfif>>#categoryname#</option>
</cfloop>
</select>

catlist looks like 1,3 and is from a seperate table.

The output is

CategoryA << selected
CategoryB
CategoryB << selected

How would i order this so that if an item is selected it is at the top of
the list?

thanks

chad


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to