Good Morning,
I am having trouble with the "selected" attribute of the <cfselect> tag. I
am trying to get it to display what is currently in the table if there is a
value already there or "select one" if there currently is no value.
I started out with the <select> tag, but it doesn't seem to have a similar
attribute. So, I tried the <cfselect>. It is working as I need, except the
existing value is not selected.
Any help would be appreciated.
Thanks,
Mark
Here is the code on my page:
<cfquery name="areaPaints" datasource="mdfinish">
SELECT AreaId, AreaName, WallPaint, TrimPaint, CeilingPaint
FROM Areas
WHERE areas.JobId = #session.JobId#
</cfquery>
<cfquery name="paintList" datasource="mdfinish">
SELECT JobPaintList.color, JobPaintList.JobPaintListId,
JobPaintList.CustomColorName, PaintColor.ColorName, PaintColor.colorNumber,
JobPaintList.line,
JobPaintList.sheen, JobPaintList.manufacturer, PaintLines.PaintLineName,
PaintSheen.PaintSheen
FROM PaintSheen INNER JOIN (PaintLines INNER JOIN (PaintColor INNER JOIN
JobPaintList ON PaintColor.ID = JobPaintList.color) ON
PaintLines.PaintLineId = JobPaintList.line) ON PaintSheen.PaintSheenId =
JobPaintList.sheen
WHERE JobPaintList.job = #session.jobId#
</cfquery>
<cfmodule template="#Request.layout#/Header.cfm" pageType="JobAdmin">
<cfset i=1>
<cfform name="setcolor" action="paintScheduleSetColorsAction.cfm">
<table width="100%">
<tr>
<th>Area Name</th>
<th>Wall Paint</th>
<th>Ceiling Paint</th>
<th>Trim Paint</th>
</tr>
<cfoutput>
<cfloop query="areaPaints">
<tr><cfset i = i + 1>
<td>#areaName#</td>
<td>
<cfselect name="wallPaint#i#" >
<option value="">Select One</option>
<cfloop query="paintList">
<option value="#JobPaintListId#">#PaintList.colorName#,
#Paintlist.ColorNumber# #PaintList.PaintLineName# #PaintList.PaintSheen#
#PaintList.CustomColorName#</option>
</cfloop>
</cfselect>
</td>
<td>
<cfselect name="ceilingPaint#i#"
selected="#areaPaints.ceilingPaint#" >
<option value="">Select One</option>
<cfloop query="paintList">
<option value="#JobPaintListId#">#PaintList.colorName#,
#Paintlist.ColorNumber# #PaintList.PaintLineName# #PaintList.PaintSheen#
#PaintList.CustomColorName#</option>
</cfloop>
</cfselect> </td>
<td>
<cfselect name="trimPaint#i#" >
<option value="">Select One</option>
<cfloop query="paintList">
<option value="#JobPaintListId#">#PaintList.colorName#,
#Paintlist.ColorNumber# #PaintList.PaintLineName# #PaintList.PaintSheen#
#PaintList.CustomColorName#</option>
</cfloop>
</cfselect> </td>
</tr>
</cfloop>
</cfoutput>
<tr>
<td>
</tr>
</table>
<button type="submit">submit</button>
</cfform>
<cfmodule template="#Request.layout#/Footer.cfm"><cfmodule
template="#Request.layout#/Footer.cfm">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219235
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54