<!---I have a tool that you can add multiple users to a project via a
multiple select box
First I get all user_ids associated with the project i want--->

<!--- get all users associated with current project --->
<cfquery name="proj_users" datasource="#request.maindsn#">
 select user_id
 from tbl_projects
 where proj_id = #val(form.project_id)#
</cfquery>


<!---And from a table of ALL users that are available to choose from I get
ALL entries--->

<!--- get ALL users to populate the select box --->
<cfquery name="getallusers" datasource="#request.maindsn#">
 select fname, lname, user_id
 from tbl_proj_users
 order by lname
</cfquery>


<!--- then loop over ALL availabel users to populate the select box --->
<!---checking them agains a list of users associated with the current
project --->
<!--- if they are found in the list, select them --->
 <cfselect name="user_id" size="5" multiple="Yes">
  <cfloop query="getallusers">
   <option value="#user_id#"cfif listfind(valuelist(proj_users.user_id),
user_id, ",")> selected</cfif>#fname# #lname#</option>
  </cfloop>
 </cfselect>


Hope it helps, goodluck

----- Original Message -----
From: "Michael Ross" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 1:59 PM
Subject: Multiple Select Box


> You know if you have a form that someone is editing data, and you can make
a select box have a record selected.  How do you do it where you want a
multiple select box to have a lot of them selected?  This is really killing
me..... Any idea's would be great
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to