I've accomplished the task by doing this, it displays the selected
values first in the list:

<select name="linemaintenanceplanes" multiple size="12">
(First loop over the existing values for "linemaintenanceplanes" and
display them.)
        <cfoutput>
        <cfloop list="#getinformation.linemaintenanceplanes#" index="i">
                <option value="#i#" selected>#i#</option>
        </cfloop>
        </cfoutput>
(Then loop over the entire list of planes, and display them only if they
aren't in the list of "selected planes")
        <cfoutput query="getplanes">
        <cfif listfindnocase(getinformation.linemaintenanceplanes,
#name#) eq 0>
                <option value="#name#">#misc1#</option>
        </cfif>
        </cfoutput> 
</select>

It seemed to fit the bill when you have a huge list also, so you don't
need to scroll through all 100 just to see what you have "selected"
already.

Greg Luce
954-763-4504


-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 26, 2001 8:57 AM
To: CF-Talk
Subject: Updating a multiple select box dynamically. question?

Hello all.
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.

i hope you know what i mean!
any help would be great!
thanks
-paul

<select name="Consultant_Types_ID" size="3" multiple> 
  <cfloop query="rs_Consultant_Types">
    <option
value="<cfoutput>#rs_Consultant_Types.Consultant_Types_ID#</cfoutput>" 
    <cfif (#rs_Consultant_Types.Consultant_Types_ID# EQ
#edit.Consultant_Types_ID#)>SELECTED</cfif>>
 
<cfoutput>#rs_Consultant_Types.Consultant_Types_Name#</cfoutput></option
>
  </cfloop>
</select>

-paul


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to