> i have a update page that has a Multiple Select box that i 
> want to be able to dynamically up date. now if there has only 
> been one prior selection, then it shows up in the update 
> select box. but if there has been more then one selection 
> made, then nothing shows up.
> 
> <select name="Consultant_Types_ID" size="3" multiple> 
>   <cfloop query="rs_Consultant_Types">
>     <option
> value="<cfoutput>#rs_Consultant_Types.Consultant_Types_ID#</cf
> output>" 
>     <cfif (#rs_Consultant_Types.Consultant_Types_ID# EQ
> #edit.Consultant_Types_ID#)>SELECTED</cfif>>
>  
> <cfoutput>#rs_Consultant_Types.Consultant_Types_Name#</cfoutpu
> t></option>
>   </cfloop>
> </select>

If you have more than one value that should be selected, you should be
checking the current value that you're looping over against a list of
selected values. Let's assume that the list of selected values is contained
in a variable My_Consultant_Types_List. If so, you could use ListFind to
mark the appropriate items as selected:

<cfif ListFind(My_Consultant_Types_List,
rs_Consultant_Types.Consultant_Types_ID)> SELECTED</cfif>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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