I have a table displaying several records. Im trying to display one of the fields, TemplateID, in a select box, but Im unable to force the correct value into the select box for each record. The first select box displays the correct value (i.e. the value of TemplateID in the first record), however, all subsequent records display the same value as the first record.
The select boxes are dynamically named to avoid naming conflicts. I *am* able to force different values into each select box if I equate the TemplateID value to #ServiceItem.CurrentRow#, but of course, thats just diagnostic, not exactly helpful. Ive ensured that each value of TemplateID does in fact exist in the select boxs option list.
Ive been battling this problem for several days a solution will be VERY APPRECIATED!
CFML and HTML Source is below.
Thanks in advance to the genius who solves this headache!
------------------
CFML Source:
<cfquery name="Templates" datasource="tmgcpa">
SELECT TemplateID, TemplateName
FROM dms_DocketTemplates
ORDER BY TemplateName
</cfquery>
<cfquery name="ServiceItems" datasource="tmgcpa">
SELECT *
FROM dms_qryClientServices
WHERE ClientID = '#URL.ClientID#'
</cfquery>
<form name="form1" method="post" action="">
<table width="740" border="1" cellspacing="0" bordercolor="#CCCCCC" class="SmallText">
<tr>
<td width="14"><input name="ClientID" type="hidden" id="ClientID" value="<cfoutput>#ServiceI
tems.Clien
tID#</cfou
tput>"></t
d>
<td width="160"><strong>Servic
e Item</strong></td>
<td width="120"><strong>Freque
ncy</stron
g></td>
<td width="300"><strong>Templa
te Triggered</strong></td>
<td width="60"><strong>Anchor Date</strong></td>
<td width="80"><strong>Lead Time</strong></td>
<td width="80">Active</td>
</tr>
<cfoutput>
<cfloop query="ServiceItems">
<tr>
<td><strong>#ServiceItems.
CurrentRow
#.
<input name="ClientServiceID" type="hidden" id="ClientServiceID" value="#ServiceItems.Clien
tServiceID
#">
</strong></td>
<td>#ServiceItems.ServiceI
tem#</td>
<td>#ServiceItems.Interval
Name2#</td
>
<td>
<!--- *********** --->
<select name="Template#ServiceItem
s.ClientSe
rviceID#" class="SmallText" id="Template" title="#ServiceItems.Templ
ateID#">
<cfloop query="Templates">
<option value="#Templates.Template
ID#" <cfif #Templates.TemplateID# EQ #ServiceItems.TemplateID#>
selected</
cfif>>#Tem
plates.Tem
plateName#
(#Templates.TemplateID#)</
option>
</cfloop>
</select>
<!--- *********** --->
</td>
<td><input name="AnchorDate#ServiceIt
ems.Client
ServiceID#
" type="text" class="SmallText" id="AnchorDate" value="#DateFormat(Service
Items.Anch
orDate, "short")#" size="10"></td>
<td><input name="LeadTime#ServiceItem
s.ClientSe
rviceID#" type="text" class="SmallText" id="LeadTime" value="#ServiceItems.LeadT
ime#" size="4"></td>
<td>
<input <cfif (#ServiceItems.Active# EQ 1)>checked</cfif> type="checkbox" name="Active#ServiceItems.
ClientServ
iceID#" value="1"></td>
</tr>
</cfloop>
</cfoutput>
</table>
</form> </td>
HTML Source:
<html><!-- InstanceBegin template="/Templates/MainT
emplate.dw
t.cfm" codeOutsideHTMLIsLocked="f
alse" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Mangold CPAs</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="2" rightmargin="0" bottommargin="0" leftmargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr bgcolor="#FFFFFF">
<td colspan="2" rowspan="2" valign="middle"><a href="mainMenu.cfm"><img src="graphics/tmgcpa_banne
r.gif" width="450" height="50" border="0"></a></td>
<td width="100%" rowspan="2" valign="top"><!--DWLayoutE
mptyCell--
> </t
d>
<td width="296" height="24" valign="top" class="MediumText"><div align="right">
User: WDN
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="26" valign="bottom"> <div align="right" class="MediumText">Decembe
r 21, 2005 </div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="30" height="655" valign="top" class="SmallText"><!--DWLa
youtEmptyC
ell-->&nbs
p;</td>
<!-- InstanceBeginEditable name="MainContent" -->
<td colspan="3" valign="top" bgcolor="#FFFFFF"><span class="menuText">MAIN
MENU > CLIENT > ADD MULTIPLE SERVICE ITEMS</span><br>
<br>
<span class="Title">Edit Client Service Items: {Handle}</span><br>
<br>
<span class="SmallText"><strong>
<a href="addMultipleServiceIt
ems.cfm">A
dd/Remove
Service Items</a></strong></span><
br>
<form name="form1" method="post" action="">
<table width="740" border="1" cellspacing="0" bordercolor="#CCCCCC" class="SmallText">
<tr>
<td width="14"><input name="ClientID" type="hidden" id="ClientID" value="1616871"></td>
<td width="160"><strong>Servic
e Item</strong></td>
<td width="120"><strong>Freque
ncy</stron
g></td>
<td width="300"><strong>Templa
te Triggered</strong></td>
<td width="60"><strong>Anchor Date</strong></td>
<td width="80"><strong>Lead Time</strong></td>
<td width="80">Active</td>
</tr>
<tr>
<td><strong>1.
<input name="ClientServiceID" type="hidden" id="ClientServiceID" value="51">
<input name="TemplateNo" type="hidden" id="TemplateNo" value="44">
</strong></td>
<td>Financial Statements</td>
<td>Monthly</td>
<td>
<select name="Template51" class="SmallText" id="Template" title="44">
<option value="13" >Tax Return - Individual - Level 4
(13)</option>
<option value="14" >Tax Return - Individual - Level 5
(14)</option>
<option value="46" >TemplateTest2
(46)</option>
<option value="47" >TemplateTest2
(47)</option>
<option value="48" >TemplateTest3
(48)</option>
<option value="49" >TemplateTest4
(49)</option>
<option value="50" >Test5
(50)</option>
<option value="44" selected>TestTemplate1
(44)</option>
<option value="45" >TestTemplate2
(45)</option>
</select>
</td>
<td><input name="AnchorDate51" type="text" class="SmallText" id="AnchorDate" value="1/1/04" size="10"></td>
<td><input name="LeadTime51" type="text" class="SmallText" id="LeadTime" value="1" size="4"></td>
<td>
<input checked type="checkbox" name="Active51" value="1"></td>
</tr>
<tr>
<td><strong>2.
<input name="ClientServiceID" type="hidden" id="ClientServiceID" value="52">
<input name="TemplateNo" type="hidden" id="TemplateNo" value="44">
</strong></td>
<td>Service Item #2</td>
<td>Daily</td>
<td>
<select name="Template52" class="SmallText" id="Template" title="44">
<option value="13" >Tax Return - Individual - Level 4
(13)</option>
<option value="14" >Tax Return - Individual - Level 5
(14)</option>
<option value="46" >TemplateTest2
(46)</option>
<option value="47" >TemplateTest2
(47)</option>
<option value="48" >TemplateTest3
(48)</option>
<option value="49" >TemplateTest4
(49)</option>
<option value="50" >Test5
(50)</option>
<option value="44" selected>TestTemplate1
(44)</option>
<option value="45" >TestTemplate2
(45)</option>
</select>
</td>
<td><input name="AnchorDate52" type="text" class="SmallText" id="AnchorDate" value="2/2/02" size="10"></td>
<td><input name="LeadTime52" type="text" class="SmallText" id="LeadTime" value="0" size="4"></td>
<td>
<input checked type="checkbox" name="Active52" value="1"></td>
</tr>
<tr>
<td><strong>3.
<input name="ClientServiceID" type="hidden" id="ClientServiceID" value="54">
<input name="TemplateNo" type="hidden" id="TemplateNo" value="44">
</strong></td>
<td>Service Item #5</td>
<td>Daily</td>
<td>
<select name="Template54" class="SmallText" id="Template" title="44">
<option value="13" >Tax Return - Individual - Level 4
(13)</option>
<option value="14" >Tax Return - Individual - Level 5
(14)</option>
<option value="46" >TemplateTest2
(46)</option>
<option value="47" >TemplateTest2
(47)</option>
<option value="48" >TemplateTest3
(48)</option>
<option value="49" >TemplateTest4
(49)</option>
<option value="50" >Test5
(50)</option>
<option value="44" selected>TestTemplate1
(44)</option>
<option value="45" >TestTemplate2
(45)</option>
</select>
</td>
<td><input name="AnchorDate54" type="text" class="SmallText" id="AnchorDate" value="3/3/03" size="10"></td>
<td><input name="LeadTime54" type="text" class="SmallText" id="LeadTime" value="0" size="4"></td>
<td>
<input checked type="checkbox" name="Active54" value="1"></td>
</tr>
<tr>
<td colspan="2"> <input type="submit" name="Submit" value="Update Service Items">
<input name="UpdateServiceItems" type="hidden" id="UpdateServiceItems" value="UpdateServiceItems"
></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form> </td>
<!-- InstanceEndEditable --></tr>
<tr>
<td height="18" colspan="4" valign="top" class="SmallText"><div align="center"><font color="#999999">©
2005 </font></div></td>
</tr>
<tr>
<td height="19"> </td>
<td width="420"></td>
<td></td>
<td></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
Start Free Trial