<cfloop index = "ListElement" list =
"#Edit_Get_Selected_PressRel.pre_cat_id#"> is the problem I think. The
column in the query won't be automatically expanded to a list - I'd
use a query-based cfloop instead.

On 3/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> All,
>
> I'm trying to populate a (categories) select form with element in edit mode. 
> I'm
> trying to loop through the entire list of categories while highlighting 
> (selected) the
> categories associated within this recordset.  I'm having a hard time getting
> multiple selections to siaply properly in edit mode. Each category_id is comma
> delimted.
>
> SAMPLE:
>
> <!-- FORM.pre_existing is coming from unique item submitted into edit mode -->
> <cfquery name="Edit_Get_Selected_PressRel" datasource="#datasource#" 
> cachedWithin = "#CreateTimeSpan(0, 0, 5, 0)#">
> SELECT *
> FROM press_rel
> WHERE press_re_id = #FORM.pre_existing#
> </cfquery>
>
> <!-- GET CATEGORIES -->
> <cfquery name="GetCategoriesOutput" datasource="#Datasource#">
> SELECT * FROM categories
> </cfquery>
>
> <!-- SPIT OUT CATEGORIES AND SHOW CATEGORIES IN THE DB.COLUMN AS SELECTED BY 
> LOOPING  -->
> <!-- PRSubmit_EDIT IS HIDDEN FORM WHEN IN EDIT MODE -->
> <select name="pre_cat_id" size="3" multiple id="cat_id">
>         <CFOUTPUT query="GetCategoriesOutput">
> <option value="#categorie_id#" <CFIF ISDEFINED ("PRSubmit_EDIT")><cfloop 
> index = "ListElement" list = "#Edit_Get_Selected_PressRel.pre_cat_id#"><CFIF 
> ListElement IS 
> GetCategoriesOutput.categorie_id>selected</CFIF></cfloop></CFIF>>#cat_name#</option>
>         </CFOUTPUT>
>       </select>

--
CFAJAX docs and other useful articles:
http://jr-holmes.coldfusionjournal.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236661
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to