This seems like a possible bug but of course my code is always suspect.
I am creating a series of select boxes from a query. These boxes are a list of
possible categories to associate with an article. When I pull up an article,
it should display select boxes for each associated category and have the
correct category selected. For example, article 1 is associated with category
Bo-L-1 and category Bo-S-2. So the drop down boxes should have these
categories seleceted as well as listing all other possible categories.
The code below works except that the select boxes all display the first
category as the selected one even though the correct category displays outside
of the select box.
Any thoughts?
Ian
<CFLOOP QUERY="getArticleSubjects">
<TR>
<TD>
Category <CFOUTPUT>#Variables.subjectCount#:
<!--- Display the current article category --->
#getArticleSubjects.CategoryCode#_#getArticleSubjects.SubcategoryCode#_#getArticleSubjects.SubjectCode#</CFOUTPUT>
<CFSELECT NAME="Category_#subjectCount#">
<OPTION VALUE=""></OPTION>
<CFOUTPUT QUERY="Application.adminGetSubject">
<!--- Check to see if the current category in the list matches the current
article category ---> <CFIF
"#Application.adminGetSubject.CategoryCode#_#Application.adminGetSubject.SubcategoryCode#_#Application.adminGetSubject.SubjectCode#"
EQ
"#getArticleSubjects.CategoryCode#_#getArticleSubjects.SubcategoryCode#_#getArticleSubjects.SubjectCode#">
<OPTION
VALUE="#Application.adminGetSubject.CategoryCode#_#Application.adminGetSubject.SubcategoryCode#_#Application.adminGetSubject.SubjectCode#"
SELECTED>#Application.adminGetSubject.CategoryCode#_#Application.adminGetSubject.SubcategoryCode#_#Application.adminGetSubject.SubjectCode#</OPTION>
<CFELSE>
<OPTION
VALUE="#Application.adminGetSubject.CategoryCode#_#Application.adminGetSubject.SubcategoryCode#_#Application.adminGetSubject.SubjectCode#">#Application.adminGetSubject.CategoryCode#_#Application.adminGetSubject.SubcategoryCode#_#Application.adminGetSubject.SubjectCode#</OPTION>
</CFIF>
</CFOUTPUT>
</CFSELECT>
</TD>
<TD COLSPAN="4">
<!--- Display the current article category names--->
<CFOUTPUT>#getArticleSubjects.Category#_#getArticleSubjects.SubCategory#<CFIF
getArticleSubjects.Subject NEQ
"Z">_#getArticleSubjects.Subject#</CFIF></CFOUTPUT>
</TD>
</TR>
<CFSET subjectCount = subjectCount + 1>
</CFLOOP>
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://home.netscape.com/webmail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebarRsts