(You seem to have both queries called the same thing. Assuming first is
QueryA.)

<cfset SelectedUsers = ValueList(QueryB.UserID)>

then...

<OPTION
        <cfif ListFind(SelectedUsers, UserID)>
                selected
        </cfif>
        value="#UserID#"
>#FirstName# #LastName#</OPTION>


Regards, 
Matthew Walker 
/* 
        Easier, smarter forms:
        http://www.matthewwalker.net.nz/inform2 
*/ 



> -----Original Message-----
> From: Tony Gruen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 23 May 2002 10:34 a.m.
> To: CF-Talk
> Subject: Populating Multiple Select
> 
> 
> Howdy oh-great-list,
> 
> I am trying to populate a multiple select that is dynamic. 
> One query holds
> the select options and another holds the list of values 
> currently in the
> database.
> 
> For example: Query A gets all users and populates the dynamic 
> select with
> 
> Susy
> Bill
> Allan
> Phillip
> 
> Query B returns results from another table indicating that 
> Allan and Phillip
> were selected last time so I want to pre-select them.
> 
> My issue is getting the dynamic select CFIF statement to populate. I
> currently have...
> 
> <!-- Query to populate select -->
> <cfquery name="QueryB" datasource="db">
> SELECT UserID,FirstName,LastName
> FROM Users
> WHERE Users.ProgramNumber = '#session.ProgramNumber#'
> </cfquery>
> 
> <!-- Query of Curently selected users -->
> <cfquery name="QueryB" datasource="db">
> SELECT *
> FROM Users_to_files
> WHERE FileID = '#URL.File#'
> </cfquery>
> 
> ..and I can't get beyond building the standard select...
> 
> <select name="MemberList" selected="Select..." tabindex="1" size="15"
> MULTIPLE>
> <cfoutput query="QueryA">
> <OPTION value="#UserID#">#FirstName# #LastName#</OPTION>
> </cfoutput>
> </select>
> 
> 
> 
> 
> 
> 
> 
> 
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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