Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 get and populate list select box w/ multiple vals

Author  Topic 

sirtcarlos
Starting Member

10 Posts

Posted - 2008-06-27 : 08:53:00
i have a multi-select input box in a form. i need to do two things with this.
i need to be able to take all values selected and put them into one column in my sql table (Comma Seperated).
i then need to be able to pull and highlight all values selected to users who revist the form later on.
i have the form working fine for one value, but it keeps breaking on multi select.
here's my code for the single select:

<!-- SELECT BOX -->
<select name="location">
<CFLOOP QUERY="get_locations">
<OPTION VALUE="#qry_location_id#"<CFIF qry_location_id EQ location_id> SELECTED</CFIF>>#qry_name#</OPTION>
</CFLOOP>
</select>

<!-- WRITE TO TABLE -->
<CFQUERY NAME="get_locations" DATASOURCE="...">
SELECT location_id as qry_location_id, name as qry_name
FROM TABLE_NAME
ORDER BY location_id
</CFQUERY>

any help is much appreciated!
thanks

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-06-27 : 09:54:11
CFLOOP. i like that!




elsasoft.org
Go to Top of Page
   

- Advertisement -