Originally posted by acoder
So like this? does the index need to be removed or put a different name behind index?
Code:
<cfloop from="1" to="#form['partscount' & machinecount]#" index="machineCount">
Rach
<cfloop from="1" to="#form['partscount' & machinecount]#" index="machineCount">
<!---Inserts parts information into parts table.---> <!---because it is a bit we don't use 'ticks' around defective for parts table---> <cfloop from="1" to="#form['partscount' & machinecount]#" index="ps"> <cfquery name="parts" datasource="CustomerSupport"> exec usp_CS_Insertparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">, '#Form.submission#' </cfquery> </cfloop>
<!---Inserts information into serial table.---> <CFIF REQUEST_METHOD EQ "POST"> <CFSET machineListLen = listLen(Form.serialcount)> <CFLOOP from="1" to="#machineListLen#" index="machineCount"> <CFSET serialnum = Form["serialnum_" & machineCount]> <CFSET modelno = Form["modelno_" & machineCount]> <CFSET producttype = Form["producttype_" & machineCount]> <CFSET softhardware = Form["softhardware_" & machineCount]> <CFSET resolution = Form["resolution_" & machineCount]> <CFSET resdate = Form["resdate_" & machineCount]> <CFSET resvertified = Form["resvertified_" & machineCount]> <CFSET vertifidate = Form["vertifidate_" & machineCount]> <CFSET deptvendor = Form["deptvendor_" & machinecount]> <CFSET hardwarefailure = Form["hardwarefailure_" & machineCount]> <CFSET rma = Form["rma_" & machineCount]> <CFSET thedescription = Form["thedescription_" & machineCount]> <CFSET hcpn = Form["hcpn_" & machineCount]> <CFSET partsreturn = Form["partsreturn_" & machineCount]> <CFSET defective = Form["defective_" & machineCount]> <!--- <CFSET followdate = Form["followdate_" & machineCount]> <CFSET onsite = Form["onsite_" & machineCount]> <CFSET numonsite = Form["numonsite_" & machineCount]>---> <cfquery name="serial" datasource="CustomerSupport"> exec usp_CS_Insertserial <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#modelno#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#producttype#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#softhardware#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#resolution#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#resdate#">, <cfqueryparam value="#resvertified#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#vertifidate#">, <cfqueryparam value="#deptvendor#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#hardwarefailure#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#rma#" CFSQLType = "CF_SQL_VARCHAR"> </cfquery> <!---Inserts information into notes_descr table.---> <cfquery name="description" datasource="CustomerSupport"> exec usp_CS_Insertdescription <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#thedescription#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.fk_addedBy#' </cfquery> <!---Inserts parts information into parts table.---> <!---because it is a bit we don't use 'ticks' around defective for parts table---> <cfloop from="1" to="#form['partscount' & machinecount]#" index="ps"> <cfquery name="parts" datasource="CustomerSupport"> exec usp_CS_Insertparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">, '#Form.submission#' </cfquery> </cfloop> </CFLOOP> </CFIF>
"<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0' >" + "<th class='sectiontitle' colspan='7'>Parts Information "+ count +" Serial Information "+serialno+"</th>" + "<tr>" + "<td class='indent' id='formfieldpadding'>HC P/N: <input type='text' name='hcpn_" + count + "' style='margin:0px'></td>" + "<td class='red'>" + "Parts been returned* " + "<input type='checkbox' name='partsreturn_" + count +"' value='1'/>" + "</td>" + "<td>" + "<td class='indent'>Defective<input type='checkbox' name='defective_" + count +"' value='1'/></td>" + "</td>" + "</tr>" + "</table>" +
<cfloop from="1" to="#form['partscount' & machinecount]#" index="ps"> <CFSET hcpn = Form["hcpn_" & machineCount]> <CFSET partsreturn = Form["partsreturn_" & machineCount]> <CFSET defective = Form["defective_" & machineCount]> <cfquery name="parts" datasource="CustomerSupport"> exec usp_CS_Insertparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">, '#Form.submission#' </cfquery> </cfloop>
<CFIF REQUEST_METHOD EQ "POST">
<cfloop from="1" to="#form['partscount' & machinecount]#" index="ps"> <CFSET hcpn = Form["hcpn_" & ps]> <CFSET partsreturn = Form["partsreturn_" & ps]> <CFSET defective = Form["defective_" & ps]> <cfquery name="parts" datasource="CustomerSupport"> exec usp_CS_Insertparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">, '#Form.submission#' </cfquery> </cfloop>
<!---Inserts information into serial table.---> <CFIF REQUEST_METHOD EQ "POST"> <CFSET machineListLen = listLen(Form.serialcount)> <CFLOOP from="1" to="#machineListLen#" index="machineCount"> <CFSET serialnum = Form["serialnum_" & machineCount]> <CFSET modelno = Form["modelno_" & machineCount]> <CFSET producttype = Form["producttype_" & machineCount]> <CFSET softhardware = Form["softhardware_" & machineCount]> <CFSET resolution = Form["resolution_" & machineCount]> <CFSET resdate = Form["resdate_" & machineCount]> <CFSET resvertified = Form["resvertified_" & machineCount]> <CFSET vertifidate = Form["vertifidate_" & machineCount]> <CFSET deptvendor = Form["deptvendor_" & machinecount]> <CFSET hardwarefailure = Form["hardwarefailure_" & machineCount]> <CFSET rma = Form["rma_" & machineCount]> <CFSET thedescription = Form["thedescription_" & machineCount]> <!--- <CFSET followdate = Form["followdate_" & machineCount]> <CFSET onsite = Form["onsite_" & machineCount]> <CFSET numonsite = Form["numonsite_" & machineCount]>---> <cfquery name="serial" datasource="CustomerSupport"> exec usp_CS_Insertserial <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#modelno#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#producttype#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#softhardware#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#resolution#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#resdate#">, <cfqueryparam value="#resvertified#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#vertifidate#">, <cfqueryparam value="#deptvendor#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#hardwarefailure#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#rma#" CFSQLType = "CF_SQL_VARCHAR"> </cfquery> <!---Inserts information into notes_descr table.---> <cfquery name="description" datasource="CustomerSupport"> exec usp_CS_Insertdescription <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#thedescription#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.fk_addedBy#' </cfquery> <!---Inserts parts information into parts table.---> <!---because it is a bit we don't use 'ticks' around defective for parts table---> <cfloop from="1" to="#form['partscount' & machinecount]#" index="ps"> <CFSET hcpn = Form["hcpn_" & ps]> <CFSET partsreturn = Form["partsreturn_" & ps]> <CFSET defective = Form["defective_" & ps]> <cfquery name="parts" datasource="CustomerSupport"> exec usp_CS_Insertparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">, <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">, '#Form.submission#' </cfquery> </cfloop> </CFLOOP> </CFIF>
<input id="partscount1" type="hidden" value="1" name="partscount1"/> <input id="serialcount" type="hidden" value="1" name="serialcount"/>
<input id="partscount2" type="hidden" value="1" name="partscount2"/> <input id="serialcount" type="hidden" value="2" name="serialcount"/>
<input type='text' name='hcpn_" + count + "_"+serialcount"' style='margin:0px'>
Comment