469,301 Members | 2,272 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

displaying previously entered multiple fields

769 512MB
Hey Everyone,

Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place.

what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly.

Currently this is what it does

serial information 1
parts 1
parts 2

serial information 2
parts 1
parts 2

and what it needs to do

serial information 1
parts 1
serial information 2
parts 1

the problem is instead of the part going with the correct serial. it basically puts the information for both parts i added under both of the 2 serials I am also having trouble deleting fields an adding fields for the parts fields.

if someone could explain what i am doing wrong with the parts i would really appreciate it. I know it has to do with the count, just not sure what i am doing wrong


here is the javascript for serial and parts that allows me to add serials and parts

Expand|Select|Wrap|Line Numbers
  1. <!---Allows us to add serial information multiple times --->
  2. <script type="text/javascript">
  3. <!---Allows us to add multiple fields --->
  4. function addInput(divName){
  5. var dynamic = document.getElementById('dynamicInput');
  6. var thevalue = document.getElementById('theValue');
  7. var count = (document.getElementById('theValue').value -1)+ 2;
  8. thevalue.value = count;
  9. var newdiv = document.createElement('div');
  10. var getparts = document.createElement('div');
  11. var divIdName = 'dynamic'+count+'Input';
  12. var partc = 'partscount'+count;
  13.  
  14. newdiv.setAttribute('id',divIdName);
  15.  
  16. <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  17. newdiv.innerHTML =
  18. "<table class='zpExpandedTable' id='modeltable'>" +
  19. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  20. "<tr>" +
  21. "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
  22. "</td>" +
  23. "<td>" +
  24.  "<select name='modelno_" + count + "' >" +
  25.  "<option value=''>Make A Selection</option>" +
  26. "<cfoutput query='models'>" + 
  27. "<option value='#model#'>#model#</option>" + 
  28. "</cfoutput>" + 
  29.  "</select>" +
  30.  "</td>" +
  31.  "<td>" +
  32. "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
  33. "</td>" +
  34. "<td>" +
  35. "<select name='producttype_" + count + "'>" +
  36. "<option value='' selected>No Choice</option>" +
  37. "<cfoutput query='getProdType'>" + 
  38. "<option value='#pk_productType#'>#pk_productType#</option>" + 
  39. "</cfoutput>" + 
  40. "</select>" +
  41. "</td>" +
  42. "<td class='red'>" +
  43. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
  44. "</td>" +
  45. "<td>" +
  46. "<select name='hardwarefailure_" + count + "'>" +
  47. "<option value='' selected>Make A Selection</option>" +
  48. "<cfoutput query='getHardwareFail'>" +
  49. "<option value='#pk_hardwareFailure#'>#pk_hardwareFailure#</option>" +
  50. "</cfoutput>" +
  51. "</select>" +
  52. "</td>" +
  53. "</tr>" +
  54. "<table>";
  55.  
  56. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  57. newdiv.innerHTML = newdiv.innerHTML +
  58. "<table class='zpExpandedTable' id='modeltable'>" +
  59. "<tr>" +
  60. "<td id='paddingformultitop'>" +
  61. "Serial Number:&nbsp;&nbsp;" +
  62. "<input type='text' name='serialnum_" + count + "'>" +
  63. "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
  64. "<select name='softhardware_" + count + "'>" +
  65. "<option value='' selected>No Choice</option>" +
  66. "<cfoutput query='getSoftHard'>" + 
  67. "<option value='#pk_softwareHardware#'>#pk_softwareHardware#</option>" + 
  68. "</cfoutput>" + 
  69. "</select>" +
  70. "</td>" +
  71. "</tr>" +
  72. "</table>";
  73.  
  74. <!--- Adds Extra fields for Description  --->
  75. newdiv.innerHTML = newdiv.innerHTML + 
  76. "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
  77. "<tr>" +
  78. "<td id='paddingformutli'>" +
  79. "Description:&nbsp;&nbsp;" + 
  80. "</td>" +
  81. "<td class='descriptionmoveinmulti'>" +
  82. "( You may enter up to 1000 characters. )"+
  83. "<br>" +
  84. "<textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'></textarea>" +
  85. "</td>" +
  86. "</tr>" +
  87. "</table>";
  88.  
  89. <!--- Adds Extra fields for Resolution  --->
  90. newdiv.innerHTML = newdiv.innerHTML +
  91. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  92. "<tr>" +
  93. "<td id='paddingformutli'>" +
  94. "Resolution:&nbsp;&nbsp;" +
  95. "</td>" +
  96. "<td class='resolutionmoveinmulti'>" +
  97. "( You may enter up to 1500 characters. )"+
  98. "<br>" +
  99. "<textarea maxlength='1500' onkeyup='return resolutionmaxlength(this)' onkeydown='return resolutionmaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'></textarea>" +
  100. "</td>" +
  101. "</tr>" +
  102. "</table>";
  103.  
  104. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  105. newdiv.innerHTML = newdiv.innerHTML +
  106. "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
  107. "<tr>" +
  108. "<td id='paddingformultitop'>" +
  109. "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  110. "</td>" +
  111. "<td>" +
  112. "<input type='text' name='resdate_" + count + "' value=''  >&nbsp;&nbsp;" +
  113.  
  114. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  115. "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
  116. "</td>" +
  117. "<td>" +
  118. "Resolution Verified as effective by:&nbsp;&nbsp;"  +
  119. "</td>" +
  120. "<td>" +
  121. "<select name='resvertified_" + count + "'>" +
  122. "<option value='' selected>Make A Selection</option>" +
  123. "<cfoutput query='gettech'><option value='#fname# #lname#'>#fname# #lname#</option></cfoutput>" +
  124. "</select>" +
  125. "</td>" +
  126. "</tr>" +
  127. "</table>";
  128.  
  129. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) and resolution vertified as effective by  --->
  130. newdiv.innerHTML = newdiv.innerHTML +
  131. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  132. "<tr>" +
  133. "<td id='paddingformultitop'>" +
  134. "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  135. "</td>" +
  136. "<td class='vertificationmoveinmulti'>" +
  137. "<input type='text' name='vertifidate_" + count + "'>&nbsp;&nbsp;" +
  138. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  139. "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
  140. "</td>" +
  141. "</tr>" +
  142. "</table>";
  143.  
  144. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  145. newdiv.innerHTML = newdiv.innerHTML +
  146. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  147. "<tr>" +
  148. "<td class='red' id='paddingformultitop'>" +
  149. "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
  150. "<select name='deptvendor_" + count + "'>" +
  151. "<option value='' selected>Make A Selection</option>" +
  152. "<cfoutput query='getDeptVendor'>" +
  153. "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
  154. " </cfoutput>" +
  155. "</select>" +
  156. "</td>" +
  157. "</tr>" +
  158. "</table>";
  159.  
  160. <!--- Adds Extra fields for RMA Data Only  --->
  161. newdiv.innerHTML = newdiv.innerHTML +
  162. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  163. "<tr>" +
  164. "<td id='paddingformultitop'>" +
  165. "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
  166. "</td>" +
  167. "<td class='rmanmoveinmulti'>" +
  168. "( You may enter up to 1000 characters. )"+
  169. "<br/>" +
  170. "<textarea maxlength='1000' onkeyup='return rmamaxlength(this)' onkeydown='return rmamaxlength(this)' rows='4' cols='60' name='rma_" + count + "'></textarea> " +
  171. "</td>" +
  172. "</tr>" +
  173. "</table>" +
  174. "<input type='hidden' name='"+partc+"' id='"+partc+"' value='0'>" +
  175. "<input type='hidden' name='serialcount' id='serialcount' value='" + count + "'>";
  176.  
  177. <!--- Adds Delete to every ticket  --->
  178. newdiv.innerHTML = newdiv.innerHTML +
  179. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  180. "<tr>" +
  181. "<td>" +
  182. "<input type='button' class='removeticket' value='Remove Serial &quot;"+ count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
  183. "</td>" +
  184. "</tr>" +
  185. "<tr>" +
  186. "<td>" + 
  187. "<input type='button' class='addticket' value='Add Parts' onclick=\"addpartInput(\'"+divIdName+"\')\">" +
  188. "</td>" +
  189. "</tr>" +
  190. "</table>";
  191.  
  192. document.getElementById(divName).appendChild(newdiv);
  193.  
  194. <!---Allows us to remove multiple fields --->
  195. function removeElement(divNum) {
  196.   var d = document.getElementById('dynamicInput');
  197.   var olddiv = document.getElementById(divNum);
  198.   d.removeChild(olddiv);
  199. }
  200. </script>
  201.  
  202.  
  203.  
  204.  
  205.  
  206. <!---Allows us to add PARTS information multiple times--->
  207. <script type="text/javascript">
  208. <!---Adds multiple fields for parts --->
  209. function addpartInput(partName){
  210. var parts = document.getElementById(partName);
  211. <!---('partsInput')--->
  212.  
  213. <!---this works if only want to add a part under the serial you are working with, but if you have
  214. serial information 1
  215. and serial information 2 an want to add information to serial information 1 you cant because parts always appear under the last serial information added if you click add parts--->
  216. var getparts = document.getElementById('div');
  217. <!---var avalue = document.getElementById('aValue');--->
  218. var serialno = partName.replace("dynamic","").replace("Input","");
  219. var avalue = document.getElementById("partscount"+serialno);
  220. <!---var count = (document.getElementById('avalue').value -1)+ 2;--->
  221. var count = parseInt(avalue.value) + 1;
  222. avalue.value = count;
  223. var partdiv = document.createElement('div');
  224. <!---var partIdName = 'part'+count+'Name';--->
  225. var partIdName = 'part' + count + 'Name' + serialno;
  226. <!---'parts'+count+'Input'--->
  227.  
  228. partdiv.setAttribute('id',partIdName);
  229.  
  230. <!--- Adds Extra fields for parts table  --->
  231. partdiv.innerHTML =
  232. <!---what used originally for this tableclass='createticketables' id='spaceup'--->
  233. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0' >" +
  234. "<th class='sectiontitle' colspan='7'>Parts Information "+ count +" Serial Information "+serialno+"</th>" +
  235. "<tr>" +
  236. "<td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;" +
  237. "<input type='text' name='hcpn_" + count + "_"+serialno+"' style='margin:0px'></td>" +
  238. "<td class='red'>" +
  239. "Parts been returned* " +
  240. "<input type='checkbox' name='partsreturn_" + count + "_"+serialno+"' value='1'>" +
  241. "</td>" +
  242. "<td>" +
  243. "<td class='indent'>Defective<input type='checkbox' name='defective_" + count +"_"+serialno+"' value='1'>" +
  244. "</td>" +
  245. "</td>" +
  246. "</tr>" +
  247. "</table>";
  248. <!---"<table table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'  >" +
  249. "<tr>" +
  250. "<td class='indent' id='formfieldpadding'>Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;"  +
  251. "<input type='text' name='followdate_" + count + "' value='' size='8'/>&nbsp;&nbsp;&nbsp;" +
  252. "Current Date<input type='checkbox' name='followcheck_"+ count +"' value='' onClick='followdate.value=fill_date()'/></td>" +
  253. "<td>On Site:</td>" +
  254. "<td><select name='onsite_" + count +"'>" +
  255. "<option value='No Choice' selected>No Choice</option>" +
  256. "<option value='Yes'>Yes</option>" +
  257. "<option value='No'>No</option>" +
  258. "</select><td>" +
  259. "<td># of Onsite:</td><td><select name='numonsite_" + count +"'>" +
  260. "<option value='' selected>No Choice</option>" +
  261. "<cfloop from='0' to='10' index='nonsite'><cfoutput>" +
  262. "<option value='#nonsite#'>#nonsite#</option></cfoutput></cfloop>" +
  263. "</select><td>" +
  264. "</tr>" +
  265. "</table>";
  266. --->
  267.  
  268. <!--- Adds Delete to every ticket  --->
  269. partdiv.innerHTML = partdiv.innerHTML +
  270. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  271. "<tr>" +
  272. "<td>" +
  273. "<input type='button' class='removeticket' value='Remove Parts &quot;"+count +"&quot;' onclick=\"removetheElement(\'"+partIdName+"\')\"></a>" +
  274. "</td>" +
  275. "</td>" +
  276. "</tr>" +
  277. "</table>";
  278.  
  279. document.getElementById(partName).appendChild(partdiv);
  280.  
  281. <!---Allows us to remove multiple fields--->
  282. function removetheElement(divNum) {
  283.   var d = document.getElementById('partsInput');
  284.   var olddiv = document.getElementById(divNum);
  285.  olddiv.parentNode.removeChild(olddiv);
  286. }
  287.  
  288. </script>
  289.  
  290.  


here is the html/coldfusion that displays what was previously entered for serials and parts.
Expand|Select|Wrap|Line Numbers
  1. <!--- Ticket Information 
  2.        This display the ticket Information--->
  3.  
  4. <!---<input type="hidden" value="0" id="theValue" />--->
  5.     <div id="dynamicInput"> 
  6.      <!--- All Ticket Information Appears Here--->
  7.  
  8.  
  9.     <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  10. <cfset count = 0>
  11. <!---<cfif serial.recordcount is 0>--->
  12. <cfoutput query="serial">
  13. <cfset model_no = #model_no#>
  14. <cfset product_type = #product_type#>
  15. <cfset type_hardware_failure = #type_hardware_failure#>
  16. <cfset software_hardware = #software_hardware#>
  17. <cfset resolution_verified_by = #resolution_verified_by#>
  18. <cfset dept_responsibility = #dept_responsibility#>
  19. <cfset count = count + 1>
  20. <div id="dynamic#count#Input">
  21. <table class="zpExpandedTable" id="modeltable"> 
  22. <th class="sectiontitletick" colspan="7">
  23. Serial Information #count# </th>
  24. <tr>
  25. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  26. </td>
  27. <td>
  28. <select name="modelno_#count#">
  29. <option value="">Make A Selection</option>
  30. <cfloop query="models">
  31. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  32. </cfloop> 
  33. </select>
  34. </td>
  35. <td>
  36. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  37. </td>
  38. <td>
  39. <select name="producttype_#count#">
  40. <option value="" selected>No Choice</option>
  41. <cfloop query="getProdType">
  42. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  43. </cfloop>
  44. </select>
  45. </td>
  46. <td class="red">
  47. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  48. </td>
  49. <td>
  50. <select name="hardwarefailure_#count#">
  51. <option value="" selected>Make A Selection</option>
  52. <cfloop query="getHardwareFail">
  53. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  54. </cfloop>
  55. </select>
  56. </td>
  57. </tr>
  58. <table>
  59.  
  60. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  61. <table class="zpExpandedTable" id="modeltable">
  62. <tr>
  63. <td id="paddingformultitop">
  64. Serial Number:&nbsp;&nbsp;
  65. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  66. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  67. <select name="softhardware_#count#">
  68. <option value="" selected>No Choice</option>
  69. <cfloop query="getSoftHard">
  70. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  71. </cfloop>
  72. </select>
  73. </td>
  74. </tr>
  75. </table>
  76.  
  77. <!--- Shows what was previously entered for Description ---> 
  78.  
  79. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  80. <tr>
  81. <td id="paddingformutli">
  82. Description:&nbsp;&nbsp;
  83. </td>
  84. <td class="descriptionmoveinmulti">
  85. #description#
  86. ( You may enter up to 1000 characters. )
  87. <br>
  88. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  89. </td>
  90. </tr>
  91. </table>
  92.  
  93. <!---Shows what was previously entered for Resolution  --->
  94.  
  95. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  96. <tr>
  97. <td id="paddingformutli">
  98. Resolution:&nbsp;&nbsp;
  99. </td>
  100. <td class="resolutionmoveinmulti">
  101. ( You may enter up to 1500 characters. )
  102. <br>
  103. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  104. </td>
  105. </tr>
  106. </table>
  107.  
  108. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  109.  
  110. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  111. <tr>
  112. <td id="paddingformultitop">
  113. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  114. </td>
  115. <td>
  116. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  117. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  118. <input type="checkbox" name="currentdateresol_#count#" 
  119. onClick="resdate_#count#.value=fill_date()">
  120. </td>
  121. <td>
  122. Resolution Verified as effective by:&nbsp;&nbsp;
  123. </td>
  124. <td>
  125. <select name="resvertified_#count#">
  126. <option value="" selected>Make A Selection</option>
  127. <cfloop query="gettech">
  128. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  129. selected</cfif>>#fname# #lname#</option>
  130. </cfloop>
  131. </select>
  132. </td>
  133. </tr>
  134. </table>
  135. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  136. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  137. <tr>
  138. <td id="paddingformultitop">
  139. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  140. </td>
  141. <td class="vertificationmoveinmulti">
  142. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  143. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  144. <input type="checkbox" name="currentdatevert_#count#" 
  145. onClick="vertifidate_#count#.value=fill_date()">
  146. </td>
  147. </tr>
  148. </table>
  149.  
  150. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  151. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  152. <tr>
  153. <td class="red" id="paddingformultitop">
  154. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  155. <select name="deptvendor_#count#">
  156. <option value="" selected>Make A Selection</option>
  157. <cfloop query="getDeptVendor">
  158. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  159. </cfloop>
  160. </select>
  161. </td>
  162. </tr>
  163. </table>
  164.  
  165. <!--- Shows what was previously entered for RMA Data Only  --->
  166. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  167. <tr>
  168. <td id="paddingformultitop">
  169. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  170. </td>
  171. <td class="rmanmoveinmulti">
  172. ( You may enter up to 1000 characters. )
  173. <br/>
  174. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count#" >#rma_data#</textarea>
  175. </td>
  176. </tr>
  177. </table>
  178. <input type="hidden" name="serialcount" value="#count#">
  179.  
  180. <!--- Adds Delete to every ticket  --->
  181. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  182. <tr>
  183. <td>
  184. <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('dynamic#count#Input')">
  185. </td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <!---<input type='button' class='addticket' value='Add Parts' onclick="addpartInput('divIdName')">--->
  190. </td>
  191. </tr>
  192. </table>
  193.  
  194. <cfset count1 = 0>
  195. <!---<cfif serial.recordcount is 0>--->
  196. <cfloop query="parts">
  197. <cfset count1 = count1 + 1>
  198. <!---THIS IS THE PARTS SECTION--->
  199. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  200. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  201. <tr>
  202. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#" style="margin:0px" value="#hc_partNo#"></td>
  203. <td class="red">
  204. Parts been returned*
  205. <input type="checkbox" name="partsreturn_#count1#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  206. </td>
  207. <td>
  208. <td class="indent">Defective<input type="checkbox" name="defective_#count#1" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  209. </td>
  210. </tr>
  211. </table>
  212.  
  213. <!--- Adds Delete to every ticket  --->
  214. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  215. <tr>
  216. <td>
  217. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  218. onclick="removetheElement('partIdName')"></a>
  219. </td>
  220. </td>
  221. </tr>
  222. </table>
  223. </cfloop>
  224. </div>
  225. </cfoutput>
  226. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  227.  
  228.  
  229. <!---If have any blanks in serial table it will make field appear--->
  230. <cfoutput query="serial">
  231. <cfset model_no = #model_no#>
  232. <cfset product_type = #product_type#>
  233. <cfset type_hardware_failure = #type_hardware_failure#>
  234. <cfset pka_serialNo = #pka_serialNo#>
  235. <cfset software_hardware = #software_hardware#>
  236. <cfset description = #description#>
  237. <cfset resolution = #resolution#>
  238. <cfset resolution_date = #resolution_date#>
  239. <cfset resolution_verified_by = #resolution_verified_by#>
  240. <cfset verification_date = #verification_date#>
  241. <cfset dept_responsibility = #dept_responsibility#>
  242. <cfset rma_data = #rma_data#>
  243. </cfoutput>
  244. <cfif serial.recordcount is 0>
  245. <cfset model_no = "">
  246. <cfset product_type = "">
  247. <cfset type_hardware_failure = "">
  248. <cfset pka_serialNo = "">
  249. <cfset software_hardware = "">
  250. <cfset description = "">
  251. <cfset resolution = "">
  252. <cfset resolution_date = "">
  253. <cfset resolution_verified_by = "">
  254. <cfset verification_date = "">
  255. <cfset dept_responsibility = "">
  256. <cfset rma_data = "">
  257. <cfinclude template="serialdisplay.cfm">
  258. </cfif>
  259. <!---
  260. <cfset count = 0>
  261. <cfoutput query="parts">
  262. <cfset count = count + 1>
  263. <div id="partscount#count#">
  264.  
  265. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  266. <tr>
  267. <td class="indent" id="formfieldpadding">Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;
  268. <input type="text" name="followdate_#count#" value="" size="8"/>&nbsp;&nbsp;&nbsp;
  269. Current Date<input type="checkbox" name="followcheck_#count#" value="" onClick="followdate.value=fill_date()"/></td>
  270. <td>On Site:</td>
  271. <td><select name="onsite_#count#">
  272. <option value="No Choice" selected>No Choice</option>
  273. <option value="Yes">Yes</option>
  274. <option value="No">No</option>
  275. </select><td>
  276. <td># of Onsite:</td><td><select name="numonsite_#count#">
  277. <option value="" selected>No Choice</option>
  278. <cfloop from="0" to="10" index="nonsite"><cfoutput>
  279. <option value="#nonsite#">#nonsite#</option></cfoutput></cfloop>
  280. </select><td>
  281. </tr>
  282. </table>
  283. <input type="hidden" name="serialcount" value="#count#">
  284.  
  285.  
  286.  
  287.  
  288. <!--- Parts Information, display parts if have or don't have a value --->
  289. <cfoutput query="parts">
  290. <cfset hc_partNo = #hc_partNo#>
  291. <cfset part_returned = #part_returned#>
  292. <cfset defective = #defective#>
  293. <cfinclude template="partsdisplay.cfm">
  294. </cfoutput>
  295. <cfif parts.recordcount is 0>
  296. <cfset hc_partNo = "">
  297. <cfset part_returned = "">
  298. <cfset defective = "">
  299. <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
  300. </cfif>
  301.  
  302. ---></div>
  303.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
  304.  
  305.  
Thank you in advance,
Rach
Oct 16 '08
482 24514
bonneylake
769 512MB
Hey Acoder,

Here is what i got in full would this be correct?

Expand|Select|Wrap|Line Numbers
  1. MAIN DIV WOULD BE HERE
  2. <cfset count = 0>
  3. <cfoutput query="serial">
  4. <cfset count = count + 1>
  5. <cfset model_no = #model_no#>
  6. <cfset product_type = #product_type#>
  7. <cfset type_hardware_failure = #type_hardware_failure#>
  8. <cfset software_hardware = #software_hardware#>
  9. <cfset resolution_verified_by = #resolution_verified_by#>
  10. <cfset dept_responsibility = #dept_responsibility#>
  11.  
  12. <div id="dynamic#count#Input"> 
  13. <table class="zpExpandedTable" id="modeltable"> 
  14. <th class="sectiontitletick" colspan="7">
  15. Serial Information #count# </th>
  16. <tr>
  17. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  18. </td>
  19. <td>
  20. <select name="modelno_#count#">
  21. <option value="">Make A Selection</option>
  22. <cfloop query="models">
  23. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  24. </cfloop> 
  25. </select></td>
  26. <td>
  27. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  28. </td>
  29. <td>
  30. <select name="producttype_#count#">
  31. <option value="" selected>No Choice</option>
  32. <cfloop query="getProdType">
  33. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  34. </cfloop>
  35. </select>
  36. </td>
  37. <td class="red">
  38. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  39. </td>
  40. <td>
  41.  
  42. <select name="hardwarefailure_#count#">
  43. <option value="" selected>Make A Selection</option>
  44. <cfloop query="getHardwareFail">
  45. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  46. </cfloop>
  47. </select>
  48. </td>
  49. </tr>
  50. <table>
  51.  
  52. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  53. <table class="zpExpandedTable" id="modeltable">
  54. <tr>
  55. <td id="paddingformultitop">
  56. Serial Number:&nbsp;&nbsp;
  57. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  58. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  59. <select name="softhardware_#count#">
  60. <option value="" selected>No Choice</option>
  61. <cfloop query="getSoftHard">
  62. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  63. </cfloop>
  64. </select>
  65.  
  66. </td>
  67. </tr>
  68. </table>
  69.  
  70. <!--- Shows what was previously entered for Description ---> 
  71.  
  72.  <cfquery name="getnotes" dbtype="query" >
  73. SELECT *
  74. FROM notes
  75. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  76. cfsqltype="cf_sql_char" maxLength="20">
  77. </cfquery>
  78. <cfloop query="getnotes">
  79.  
  80. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  81. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  82. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  83. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  84. <tr><td id="paddingformutli">
  85. Previously Submitted Descriptions:</td><td id="paddingformutli">
  86. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  87. <cfloop query="getnotes">
  88. Added By: #fk_addedBy# <br/>
  89. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  90. #description#
  91. <div id="line"></div>
  92. </cfloop></div></td>
  93.  
  94. </tr>
  95. </table>
  96. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  97. <tr>
  98. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  99. <td id="paddingformutli">
  100. Description:&nbsp;&nbsp;
  101. </td>
  102. <td class="descriptionmoveinmulti">
  103.  
  104. ( You may enter up to 1000 characters. )
  105. <br>
  106. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  107.  
  108. </td>
  109. </tr>
  110. </table>
  111. <!---Shows what was previously entered for Resolution ---> 
  112.  
  113. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  114. <tr>
  115. <td id="paddingformutli">
  116. Resolution:&nbsp;&nbsp;
  117. </td>
  118. <td class="resolutionmoveinmulti">
  119. ( You may enter up to 1500 characters. )
  120. <br>
  121. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  122. </td>
  123. </tr>
  124. </table>
  125.  
  126. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  127.  
  128. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  129. <tr>
  130. <td id="paddingformultitop">
  131. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  132. </td>
  133. <td>
  134. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  135. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  136. <input type="checkbox" name="currentdateresol_#count#" 
  137. onClick="resdate_#count#.value=fill_date()">
  138. </td>
  139. <td>
  140. Resolution Verified as effective by:&nbsp;&nbsp;
  141. </td>
  142. <td>
  143. <select name="resvertified_#count#">
  144. <option value="" selected>Make A Selection</option>
  145. <cfloop query="gettech">
  146. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  147. selected</cfif>>#fname# #lname#</option>
  148. </cfloop>
  149. </select>
  150. </td>
  151. </tr>
  152. </table>
  153. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  154. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  155. <tr>
  156. <td id="paddingformultitop">
  157. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  158. </td>
  159. <td class="vertificationmoveinmulti">
  160. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  161. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  162. <input type="checkbox" name="currentdatevert_#count#" 
  163. onClick="vertifidate_#count#.value=fill_date()">
  164.  
  165. </td>
  166. </tr>
  167. </table>
  168.  
  169. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  170. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  171. <tr>
  172. <td class="red" id="paddingformultitop">
  173. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  174. <select name="deptvendor_#count#">
  175. <option value="" selected>Make A Selection</option>
  176. <cfloop query="getDeptVendor">
  177. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  178. </cfloop>
  179. </select>
  180. </td>
  181. </tr>
  182. </table>
  183. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  184.  
  185.  
  186.  
  187. <!--- Adds Delete to every ticket  --->
  188. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  189. <tr>
  190. <td>
  191. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  192. </td>
  193. </tr>
  194. <tr>
  195. <td>
  196. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  197. </td>
  198. </tr>
  199. </table>
  200.  
  201.  
  202. <!---Shows what was previously entered into parts table--->
  203. <!---dbtype="query"--->
  204. <cfquery name="getparts" dbtype="query" >
  205. SELECT *
  206. FROM parts
  207. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  208. cfsqltype="cf_sql_char" maxLength="20">
  209. </cfquery>
  210. <cfset count1 = 0>
  211. <!---<cfif serial.recordcount is 0>--->
  212. <cfloop query="getparts">
  213. <cfset count1 = count1 + 1>
  214. <div id="part#count1#Name#count#">
  215. <!---<cfset partliststr = "">
  216. <cfloop from="1" to="#count1#" index="pl">
  217. <cfset partliststr = partliststr & #pl# & ",">
  218. </cfloop>
  219.  
  220. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  221. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  222.  
  223. <!---THIS IS THE PARTS SECTION--->
  224.  
  225. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  226.  
  227. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  228. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  229. <tr>
  230. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  231. <td>
  232. Parts been returned*
  233. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  234. </td>
  235. <td>
  236. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  237. </td>
  238. </tr>
  239. </table>
  240. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  241.  
  242.  
  243. <!--- Shows what was previously entered for RMA Data Only  --->
  244. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  245. <tr>
  246. <td id="paddingformultitop">
  247. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  248. </td>
  249. <td class="rmanmoveinmulti">
  250. ( You may enter up to 1000 characters. )
  251. <br/>
  252. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  253. </tr>
  254. </table>
  255.  
  256.  
  257. <!--- Adds Delete to every ticket  --->
  258. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  259. <tr>
  260. <td>
  261. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  262. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
  263. </td>
  264. </td>
  265. </tr>
  266. </table>
  267. </div>
  268. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  269. </cfloop>
  270. </div>
  271. <!---this one makes it so you can add a part to a previously submitted serial--->
  272. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  273. </cfoutput>
  274.  
  275. <cfif serial.recordcount is 0>
  276. <cfset model_no = "">
  277. <cfset product_type = "">
  278. <cfset type_hardware_failure = "">
  279. <cfset pka_serialNo = "">
  280. <cfset software_hardware = "">
  281. <cfset description = "">
  282. <cfset resolution = "">
  283. <cfset resolution_date = "">
  284. <cfset resolution_verified_by = "">
  285. <cfset verification_date = "">
  286. <cfset dept_responsibility = "">
  287. <cfinclude template="serialpartsdisplay.cfm">
  288. </cfif>
  289. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  290. END OF MAIN DIV HERE
  291.  
but what i am confused on is how would i do the parts? i got serial working but parts i don't. would i just start another cfif below the serial like i have below or how we had done it before ?
Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="parts">
  2. <cfset hc_partNo = #hc_partNo#>
  3. <cfset part_returned = #part_returned#>
  4. <cfset defective = #defective#>
  5. <cfset rma_number = #rma_number#>
  6. <!---<cfinclude template="serialpartsdisplaytest.cfm">--->
  7. </cfoutput>
  8. <cfif parts.recordcount is 0>
  9. <cfset hc_partNo = "">
  10. <cfset part_returned = "">
  11. <cfset defective = "">
  12. <cfset rma_number = "">
  13. <!---<cfinclude template="serialpartsdisplaytest.cfm">--->
  14. </cfif>
  15.  
  16.  
  17.  


Thank you,
Rach
Nov 26 '08 #401
acoder
16,027 Expert Mod 8TB
The template should only contain the table for display. Things like setting of variables and counts, etc. should be in the main page, so that the template can be reused. This may seem like overkill now, but will save you a headache later when you have to change something.

For parts, yes, you could use a template if you're going to display an empty part table when there are no parts.
Nov 26 '08 #402
bonneylake
769 512MB
Hey Acoder,

Everything that i displayed in #401 (or above) is on the main page. Including the cfset. The only thing that is on the template is the following

Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4. <cfset count = 1>
  5. <cfoutput>
  6. <div id="dynamic#count#Input"> 
  7. <table class="zpExpandedTable" id="modeltable"> 
  8. <th class="sectiontitletick" colspan="7">
  9. Serial Information #count# </th>
  10. <tr>
  11. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  12. </td>
  13. <td>
  14. <select name="modelno_#count#">
  15. <option value="">Make A Selection</option>
  16. <cfloop query="models">
  17. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  18. </cfloop> 
  19. </select></td>
  20. <td>
  21. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  22. </td>
  23. <td>
  24. <select name="producttype_#count#">
  25. <option value="" selected>No Choice</option>
  26. <cfloop query="getProdType">
  27. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  28. </cfloop>
  29. </select>
  30. </td>
  31. <td class="red">
  32. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  33. </td>
  34. <td>
  35.  
  36. <select name="hardwarefailure_#count#">
  37. <option value="" selected>Make A Selection</option>
  38. <cfloop query="getHardwareFail">
  39. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  40. </cfloop>
  41. </select>
  42. </td>
  43. </tr>
  44. <table>
  45.  
  46. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  47. <table class="zpExpandedTable" id="modeltable">
  48. <tr>
  49. <td id="paddingformultitop">
  50. Serial Number:&nbsp;&nbsp;
  51. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  52. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  53. <select name="softhardware_#count#">
  54. <option value="" selected>No Choice</option>
  55. <cfloop query="getSoftHard">
  56. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  57. </cfloop>
  58. </select>
  59.  
  60. </td>
  61. </tr>
  62. </table>
  63.  
  64. <!--- Shows what was previously entered for Description ---> 
  65.  
  66.  <cfquery name="getnotes" dbtype="query" >
  67. SELECT *
  68. FROM notes
  69. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  70. cfsqltype="cf_sql_char" maxLength="20">
  71. </cfquery>
  72. <cfloop query="getnotes">
  73.  
  74. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  75. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  76. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  77. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  78. <tr><td id="paddingformutli">
  79. Previously Submitted Descriptions:</td><td id="paddingformutli">
  80. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  81. <cfloop query="getnotes">
  82. Added By: #fk_addedBy# <br/>
  83. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  84. #description#
  85. <div id="line"></div>
  86. </cfloop></div></td>
  87.  
  88. </tr>
  89. </table>
  90. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  91. <tr>
  92. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  93. <td id="paddingformutli">
  94. Description:&nbsp;&nbsp;
  95. </td>
  96. <td class="descriptionmoveinmulti">
  97.  
  98. ( You may enter up to 1000 characters. )
  99. <br>
  100. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  101.  
  102. </td>
  103. </tr>
  104. </table>
  105. <!---Shows what was previously entered for Resolution ---> 
  106.  
  107. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  108. <tr>
  109. <td id="paddingformutli">
  110. Resolution:&nbsp;&nbsp;
  111. </td>
  112. <td class="resolutionmoveinmulti">
  113. ( You may enter up to 1500 characters. )
  114. <br>
  115. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  116. </td>
  117. </tr>
  118. </table>
  119.  
  120. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  121.  
  122. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  123. <tr>
  124. <td id="paddingformultitop">
  125. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  126. </td>
  127. <td>
  128. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  129. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  130. <input type="checkbox" name="currentdateresol_#count#" 
  131. onClick="resdate_#count#.value=fill_date()">
  132. </td>
  133. <td>
  134. Resolution Verified as effective by:&nbsp;&nbsp;
  135. </td>
  136. <td>
  137. <select name="resvertified_#count#">
  138. <option value="" selected>Make A Selection</option>
  139. <cfloop query="gettech">
  140. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  141. selected</cfif>>#fname# #lname#</option>
  142. </cfloop>
  143. </select>
  144. </td>
  145. </tr>
  146. </table>
  147. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  148. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  149. <tr>
  150. <td id="paddingformultitop">
  151. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  152. </td>
  153. <td class="vertificationmoveinmulti">
  154. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  155. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  156. <input type="checkbox" name="currentdatevert_#count#" 
  157. onClick="vertifidate_#count#.value=fill_date()">
  158.  
  159. </td>
  160. </tr>
  161. </table>
  162.  
  163. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  164. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  165. <tr>
  166. <td class="red" id="paddingformultitop">
  167. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  168. <select name="deptvendor_#count#">
  169. <option value="" selected>Make A Selection</option>
  170. <cfloop query="getDeptVendor">
  171. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  172. </cfloop>
  173. </select>
  174. </td>
  175. </tr>
  176. </table>
  177. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  178.  
  179.  
  180.  
  181. <!--- Adds Delete to every ticket  --->
  182. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  183. <tr>
  184. <td>
  185. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  186. </td>
  187. </tr>
  188. <tr>
  189. <td>
  190. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  191. </td>
  192. </tr>
  193. </table>
  194.  
  195.  
  196. <!---Shows what was previously entered into parts table--->
  197. <!---dbtype="query"--->
  198. <cfquery name="getparts" dbtype="query" >
  199. SELECT *
  200. FROM parts
  201. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  202. cfsqltype="cf_sql_char" maxLength="20">
  203. </cfquery>
  204. <cfset count1 = 0>
  205. <!---<cfif serial.recordcount is 0>--->
  206. <cfloop query="getparts">
  207. <cfset count1 = count1 + 1>
  208. <div id="part#count1#Name#count#">
  209. <!---<cfset partliststr = "">
  210. <cfloop from="1" to="#count1#" index="pl">
  211. <cfset partliststr = partliststr & #pl# & ",">
  212. </cfloop>
  213.  
  214. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  215. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  216.  
  217. <!---THIS IS THE PARTS SECTION--->
  218.  
  219. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  220.  
  221. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  222. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  223. <tr>
  224. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  225. <td>
  226. Parts been returned*
  227. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  228. </td>
  229. <td>
  230. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  231. </td>
  232. </tr>
  233. </table>
  234. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  235.  
  236.  
  237. <!--- Shows what was previously entered for RMA Data Only  --->
  238. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  239. <tr>
  240. <td id="paddingformultitop">
  241. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  242. </td>
  243. <td class="rmanmoveinmulti">
  244. ( You may enter up to 1000 characters. )
  245. <br/>
  246. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  247. </tr>
  248. </table>
  249.  
  250.  
  251. <!--- Adds Delete to every ticket  --->
  252. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  253. <tr>
  254. <td>
  255. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  256. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
  257. </td>
  258. </td>
  259. </tr>
  260. </table>
  261. </div>
  262. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  263. </cfloop>
  264. </div>
  265. <!---this one makes it so you can add a part to a previously submitted serial--->
  266. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  267. </cfoutput>


but with the parts, your saying to create another template for it right? i tried already to make a separate template for just parts an i ran into lots of trouble with it, it wouldn't count right, it wouldn't show up at some points, an sometimes i couldn't add parts. Is there a way i could use the same template since parts is already inbetween on the serialpartsdisplay.cfm template?

Thank you,
Rach
Nov 26 '08 #403
acoder
16,027 Expert Mod 8TB
OK, I actually meant the div "dynamic#count#input" and all its contents should be in the template. The rest should be outside.

You have the serials working with the template, so we can work on that first and worry about parts later.
Nov 26 '08 #404
bonneylake
769 512MB
Hey Acoder,

Your saying to take the dynamiccount, put it in the template an then what about the main page? do i need to take dynamiccount and everything between it out of the main page?

Thank you,
Rach
Nov 26 '08 #405
acoder
16,027 Expert Mod 8TB
Yes, that would be the idea, but of course, backup first so you can go back if things don't go quite as planned.
Nov 26 '08 #406
bonneylake
769 512MB
Hey Acoder,

Alright here is what i have on the main page in full. It is counting correctly for both serials that already had serials and ones that did not have serials. An there both counting correct when i add serials to both. But i can still not get parts to come up if a serial was not added. When i add parts it adds parts correctly it is just not showing the parts table if a part was not filled out.

Expand|Select|Wrap|Line Numbers
  1.   <div id="dynamicInput"> 
  2.      <!--- All Ticket Information Appears Here--->
  3.  
  4. <cfset count = 0>
  5. <cfoutput query="serial">
  6. <cfset count = count + 1>
  7. <cfset model_no = #model_no#>
  8. <cfset product_type = #product_type#>
  9. <cfset type_hardware_failure = #type_hardware_failure#>
  10. <cfset software_hardware = #software_hardware#>
  11. <cfset resolution_verified_by = #resolution_verified_by#>
  12. <cfset dept_responsibility = #dept_responsibility#>
  13. <cfinclude template="serialpartsdisplay.cfm">
  14. </cfoutput>
  15.  
  16. <cfif serial.recordcount is 0>
  17. <cfset count = 1>
  18. <cfset model_no = "">
  19. <cfset product_type = "">
  20. <cfset type_hardware_failure = "">
  21. <cfset pka_serialNo = "">
  22. <cfset software_hardware = "">
  23. <cfset description = "">
  24. <cfset resolution = "">
  25. <cfset resolution_date = "">
  26. <cfset resolution_verified_by = "">
  27. <cfset verification_date = "">
  28. <cfset dept_responsibility = "">
  29.  
  30. <cfinclude template="serialpartsdisplay.cfm">
  31. </cfif>
  32.  
  33. <!--- <cfoutput query="parts">
  34.  <cfset hc_partNo = #hc_partNo#>
  35. <cfset part_returned = #part_returned#>
  36.  <cfset defective = #defective#>
  37. <cfset rma_number = #rma_number#>
  38. <cfinclude template="serialpartsdisplay.cfm">
  39.  </cfoutput>--->
  40. <cfif getparts.recordcount is 0>
  41. <cfset hc_partNo = "">
  42. <cfset part_returned = "">
  43. <cfset defective = "">
  44. <cfset rma_number = "">
  45. <!---<cfinclude template="serialpartsdisplay.cfm">--->
  46. </cfif>
  47.  
  48. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  49. </div>
  50.  
  51.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
  52.  

an here is what i have on the template page

Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4. <cfoutput>
  5. <div id="dynamic#count#Input"> 
  6. <table class="zpExpandedTable" id="modeltable"> 
  7. <th class="sectiontitletick" colspan="7">
  8. Serial Information #count# </th>
  9. <tr>
  10. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  11. </td>
  12. <td>
  13. <select name="modelno_#count#">
  14. <option value="">Make A Selection</option>
  15. <cfloop query="models">
  16. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  17. </cfloop> 
  18. </select></td>
  19. <td>
  20. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  21. </td>
  22. <td>
  23. <select name="producttype_#count#">
  24. <option value="" selected>No Choice</option>
  25. <cfloop query="getProdType">
  26. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  27. </cfloop>
  28. </select>
  29. </td>
  30. <td class="red">
  31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  32. </td>
  33. <td>
  34.  
  35. <select name="hardwarefailure_#count#">
  36. <option value="" selected>Make A Selection</option>
  37. <cfloop query="getHardwareFail">
  38. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  39. </cfloop>
  40. </select>
  41. </td>
  42. </tr>
  43. <table>
  44.  
  45. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  46. <table class="zpExpandedTable" id="modeltable">
  47. <tr>
  48. <td id="paddingformultitop">
  49. Serial Number:&nbsp;&nbsp;
  50. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  51. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  52. <select name="softhardware_#count#">
  53. <option value="" selected>No Choice</option>
  54. <cfloop query="getSoftHard">
  55. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  56. </cfloop>
  57. </select>
  58.  
  59. </td>
  60. </tr>
  61. </table>
  62.  
  63. <!--- Shows what was previously entered for Description ---> 
  64.  
  65.  <cfquery name="getnotes" dbtype="query" >
  66. SELECT *
  67. FROM notes
  68. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  69. cfsqltype="cf_sql_char" maxLength="20">
  70. </cfquery>
  71. <cfloop query="getnotes">
  72.  
  73. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  74. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  75. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  76. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  77. <tr><td id="paddingformutli">
  78. Previously Submitted Descriptions:</td><td id="paddingformutli">
  79. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  80. <cfloop query="getnotes">
  81. Added By: #fk_addedBy# <br/>
  82. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  83. #description#
  84. <div id="line"></div>
  85. </cfloop></div></td>
  86.  
  87. </tr>
  88. </table>
  89. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  90. <tr>
  91. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  92. <td id="paddingformutli">
  93. Description:&nbsp;&nbsp;
  94. </td>
  95. <td class="descriptionmoveinmulti">
  96.  
  97. ( You may enter up to 1000 characters. )
  98. <br>
  99. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  100.  
  101. </td>
  102. </tr>
  103. </table>
  104. <!---Shows what was previously entered for Resolution ---> 
  105.  
  106. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  107. <tr>
  108. <td id="paddingformutli">
  109. Resolution:&nbsp;&nbsp;
  110. </td>
  111. <td class="resolutionmoveinmulti">
  112. ( You may enter up to 1500 characters. )
  113. <br>
  114. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  115. </td>
  116. </tr>
  117. </table>
  118.  
  119. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  120.  
  121. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  122. <tr>
  123. <td id="paddingformultitop">
  124. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  125. </td>
  126. <td>
  127. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  128. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  129. <input type="checkbox" name="currentdateresol_#count#" 
  130. onClick="resdate_#count#.value=fill_date()">
  131. </td>
  132. <td>
  133. Resolution Verified as effective by:&nbsp;&nbsp;
  134. </td>
  135. <td>
  136. <select name="resvertified_#count#">
  137. <option value="" selected>Make A Selection</option>
  138. <cfloop query="gettech">
  139. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  140. selected</cfif>>#fname# #lname#</option>
  141. </cfloop>
  142. </select>
  143. </td>
  144. </tr>
  145. </table>
  146. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  147. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  148. <tr>
  149. <td id="paddingformultitop">
  150. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  151. </td>
  152. <td class="vertificationmoveinmulti">
  153. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  154. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  155. <input type="checkbox" name="currentdatevert_#count#" 
  156. onClick="vertifidate_#count#.value=fill_date()">
  157.  
  158. </td>
  159. </tr>
  160. </table>
  161.  
  162. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  163. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  164. <tr>
  165. <td class="red" id="paddingformultitop">
  166. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  167. <select name="deptvendor_#count#">
  168. <option value="" selected>Make A Selection</option>
  169. <cfloop query="getDeptVendor">
  170. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  171. </cfloop>
  172. </select>
  173. </td>
  174. </tr>
  175. </table>
  176. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  177.  
  178.  
  179.  
  180. <!--- Adds Delete to every ticket  --->
  181. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  182. <tr>
  183. <td>
  184. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  185. </td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  190. </td>
  191. </tr>
  192. </table>
  193.  
  194.  
  195. <!---Shows what was previously entered into parts table--->
  196. <!---dbtype="query"--->
  197. <cfquery name="getparts" dbtype="query" >
  198. SELECT *
  199. FROM parts
  200. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  201. cfsqltype="cf_sql_char" maxLength="20">
  202. </cfquery>
  203. <cfset count1 = 0>
  204. <!---<cfif serial.recordcount is 0>--->
  205. <cfloop query="getparts">
  206. <cfset count1 = count1 + 1>
  207. <div id="part#count1#Name#count#">
  208. <!---<cfset partliststr = "">
  209. <cfloop from="1" to="#count1#" index="pl">
  210. <cfset partliststr = partliststr & #pl# & ",">
  211. </cfloop>
  212.  
  213. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  214. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  215.  
  216. <!---THIS IS THE PARTS SECTION--->
  217.  
  218. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  219.  
  220. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  221. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  222. <tr>
  223. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  224. <td>
  225. Parts been returned*
  226. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  227. </td>
  228. <td>
  229. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  230. </td>
  231. </tr>
  232. </table>
  233. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  234.  
  235.  
  236. <!--- Shows what was previously entered for RMA Data Only  --->
  237. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  238. <tr>
  239. <td id="paddingformultitop">
  240. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  241. </td>
  242. <td class="rmanmoveinmulti">
  243. ( You may enter up to 1000 characters. )
  244. <br/>
  245. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  246. </tr>
  247. </table>
  248.  
  249.  
  250. <!--- Adds Delete to every ticket  --->
  251. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  252. <tr>
  253. <td>
  254. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  255. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
  256. </td>
  257. </td>
  258. </tr>
  259. </table>
  260. </div>
  261. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  262. </cfloop>
  263. </div>
  264. <!---this one makes it so you can add a part to a previously submitted serial--->
  265. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  266. </cfoutput>


Thank you,
Rach
Nov 26 '08 #407
acoder
16,027 Expert Mod 8TB
That's good except that the cfoutput should be outside the template (in the cfif serial record count check where the template is called the second time).

For the parts, create another template with the parts div (div#count1#Name#count#) with counts and fields, etc. in the serial template.
Nov 26 '08 #408
bonneylake
769 512MB
Hey Acoder,

So are you saying something like this

Expand|Select|Wrap|Line Numbers
  1. <cfset count = 0>
  2. <cfoutput query="serial">
  3. <cfset count = count + 1>
  4. <cfset model_no = #model_no#>
  5. <cfset product_type = #product_type#>
  6. <cfset type_hardware_failure = #type_hardware_failure#>
  7. <cfset software_hardware = #software_hardware#>
  8. <cfset resolution_verified_by = #resolution_verified_by#>
  9. <cfset dept_responsibility = #dept_responsibility#>
  10. <cfinclude template="serialpartsdisplay.cfm">
  11. <cfif serial.recordcount is 0>
  12. <cfset count = 1>
  13. <cfset model_no = "">
  14. <cfset product_type = "">
  15. <cfset type_hardware_failure = "">
  16. <cfset pka_serialNo = "">
  17. <cfset software_hardware = "">
  18. <cfset description = "">
  19. <cfset resolution = "">
  20. <cfset resolution_date = "">
  21. <cfset resolution_verified_by = "">
  22. <cfset verification_date = "">
  23. <cfset dept_responsibility = "">
  24. <cfinclude template="serialpartsdisplay.cfm">
  25. </cfif>
  26. </cfoutput>
an well i got parts to come up ( if i left the cfoutput where it was before this post). But the thing is parts is not counting it just says #count# or #count1#. Here is what i got on the serialpartsdisplay.cfm page

Expand|Select|Wrap|Line Numbers
  1. <!---Shows what was previously entered into parts table--->
  2. <!---dbtype="query"--->
  3. <cfquery name="getparts" dbtype="query" >
  4. SELECT *
  5. FROM parts
  6. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  7. cfsqltype="cf_sql_char" maxLength="20">
  8. </cfquery>
  9. <cfset count1 = 0>
  10. <!---<cfif serial.recordcount is 0>--->
  11. <cfloop query="getparts">
  12. <cfset count1 = count1 + 1>
  13. <cfinclude template="parts.cfm">
  14. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  15.  
  16. </cfloop>
here is whats on the parts.cfm page

Expand|Select|Wrap|Line Numbers
  1. <div id="part#count1#Name#count#">
  2. <!---<cfset partliststr = "">
  3. <cfloop from="1" to="#count1#" index="pl">
  4. <cfset partliststr = partliststr & #pl# & ",">
  5. </cfloop>
  6.  
  7. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  8. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  9.  
  10. <!---THIS IS THE PARTS SECTION--->
  11.  
  12. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  13.  
  14. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  15. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  16. <tr>
  17. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  18. <td>
  19. Parts been returned*
  20. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  21. </td>
  22. <td>
  23. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  24. </td>
  25. </tr>
  26. </table>
  27. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  28.  
  29.  
  30. <!--- Shows what was previously entered for RMA Data Only  --->
  31. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  32. <tr>
  33. <td id="paddingformultitop">
  34. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  35. </td>
  36. <td class="rmanmoveinmulti">
  37. ( You may enter up to 1000 characters. )
  38. <br/>
  39. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  40. </tr>
  41. </table>
  42.  
  43.  
  44. <!--- Adds Delete to every ticket  --->
  45. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  46. <tr>
  47. <td>
  48. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  49. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
  50. </td>
  51. </td>
  52. </tr>
  53. </table>
  54. </div>
  55.  

an here is whats on the main page under neath all the cfif
Expand|Select|Wrap|Line Numbers
  1. cfset count1 = 0>
  2. <cfoutput query="parts">
  3. <cfset count1 = count1 + 1>
  4. <cfset hc_partNo = #hc_partNo#>
  5. <cfset part_returned = #part_returned#>
  6. <cfset defective = #defective#>
  7. <cfset rma_number = #rma_number#>
  8. <cfinclude template="parts.cfm">
  9. </cfoutput>
  10. <cfif parts.recordcount is 0>
  11. <cfset count1 = 1>
  12. <cfset hc_partNo = "">
  13. <cfset part_returned = "">
  14. <cfset defective = "">
  15. <cfset rma_number = "">
  16. <cfinclude template="parts.cfm">
  17. </cfif>
  18.  
Thank you,
Rach
Nov 26 '08 #409
acoder
16,027 Expert Mod 8TB
You shouldn't need the parts in two places. If it's in the serial template (where it should be), it's not needed on the main page.

For the serials, the cfoutput loop should be complete before the cfif. Then in the cfif record count tag, put cfoutput tags.
Nov 26 '08 #410
bonneylake
769 512MB
Hey Acoder,

So your saying something like this correct?

Expand|Select|Wrap|Line Numbers
  1. <cfset count = 0>
  2.  <cfoutput query="serial">
  3.  <cfset count = count + 1>
  4.  <cfset model_no = #model_no#>
  5.  <cfset product_type = #product_type#>
  6.  <cfset type_hardware_failure = #type_hardware_failure#>
  7.  <cfset software_hardware = #software_hardware#>
  8.  <cfset resolution_verified_by = #resolution_verified_by#>
  9.  <cfset dept_responsibility = #dept_responsibility#>
  10.  <cfinclude template="serialpartsdisplay.cfm">
  11.    </cfoutput>
  12.   <cfoutput>
  13.  <cfif serial.recordcount is 0>
  14.  <cfset count = 1>
  15.  <cfset model_no = "">
  16.  <cfset product_type = "">
  17.  <cfset type_hardware_failure = "">
  18.  <cfset pka_serialNo = "">
  19.  <cfset software_hardware = "">
  20.  <cfset description = "">
  21.  <cfset resolution = "">
  22.  <cfset resolution_date = "">
  23.  <cfset resolution_verified_by = "">
  24.  <cfset verification_date = "">
  25.  <cfset dept_responsibility = "">
  26.  <cfinclude template="serialpartsdisplay.cfm">
  27.  </cfif>
  28. </cfoutput>
an well parts comes up if i added a part in a previous serial. But if i didn't add a serial, the empty serial table comes up but the empty parts table is still not coming up. Any ideas?

Thank you,
Rach
Nov 26 '08 #411
acoder
16,027 Expert Mod 8TB
Almost - move the cfoutput tags on lines 12 and 28 to just around the template on line 26.

For the parts, you need to add a cfif similar to serials which checks the record count of the getparts query and includes parts.cfm a second time.
Nov 26 '08 #412
bonneylake
769 512MB
Hey Acoder,

So would this be correct for serial and parts?

Expand|Select|Wrap|Line Numbers
  1. <cfset count = 0>
  2.  <cfoutput query="serial">
  3.  <cfset count = count + 1>
  4.  <cfset model_no = #model_no#>
  5.  <cfset product_type = #product_type#>
  6.  <cfset type_hardware_failure = #type_hardware_failure#>
  7.  <cfset software_hardware = #software_hardware#>
  8.  <cfset resolution_verified_by = #resolution_verified_by#>
  9.  <cfset dept_responsibility = #dept_responsibility#>
  10.  <cfinclude template="serialpartsdisplay.cfm">
  11.    </cfoutput>
  12.  
  13. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  14.  <cfif serial.recordcount is 0>
  15.  <cfset count = 1>
  16.  <cfset model_no = "">
  17.  <cfset product_type = "">
  18.  <cfset type_hardware_failure = "">
  19.  <cfset pka_serialNo = "">
  20.  <cfset software_hardware = "">
  21.  <cfset description = "">
  22.  <cfset resolution = "">
  23.  <cfset resolution_date = "">
  24.  <cfset resolution_verified_by = "">
  25.  <cfset verification_date = "">
  26.  <cfset dept_responsibility = "">
  27.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  28.  </cfif>
  29.  
  30. <cfset count1 = 0>
  31. <cfoutput query="parts">
  32. <cfset count1 = count1 + 1>
  33. <cfset hc_partNo = #hc_partNo#>
  34. <cfset part_returned = #part_returned#>
  35. <cfset defective = #defective#>
  36. <cfset rma_number = #rma_number#>
  37. <cfinclude template="parts.cfm">
  38.    </cfoutput>
  39.  <cfif parts.recordcount is 0>
  40.  <cfset count = 1>
  41. <cfset hc_partNo = "">
  42. <cfset part_returned = "">
  43. <cfset defective = "">
  44. <cfset rma_number = "">
  45.    <cfoutput><cfinclude template="parts.cfm"></cfoutput>
  46.  </cfif>
Thank you,
Rach
Nov 26 '08 #413
acoder
16,027 Expert Mod 8TB
Yes, except that the parts code should be in the serial template (where you want the parts to appear).
Nov 27 '08 #414
bonneylake
769 512MB
Hey Acoder ,

would something like this work?

Expand|Select|Wrap|Line Numbers
  1.    <cfset count = 0>
  2.     <cfoutput query="serial">
  3.    <cfset count = count + 1>
  4.    <cfset model_no = #model_no#>
  5.    <cfset product_type = #product_type#>
  6.   <cfset type_hardware_failure = #type_hardware_failure#>
  7.    <cfset software_hardware = #software_hardware#>
  8. <cfset resolution_verified_by = #resolution_verified_by#>
  9. <cfset dept_responsibility = #dept_responsibility#>
  10. <cfinclude template="serialpartsdisplay.cfm">
  11.     </cfoutput>
  12.  <cfset count1 = 0>
  13. <cfoutput query="parts">
  14. <cfset count1 = count1 + 1>
  15.  <cfset hc_partNo = #hc_partNo#>
  16.   <cfset part_returned = #part_returned#>
  17.  <cfset defective = #defective#>
  18.  <cfset rma_number = #rma_number#>
  19.    <cfinclude template="parts.cfm">
  20.   </cfoutput>
  21.  
  22.  
  23.  
  24. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  25. <cfif serial.recordcount is 0>
  26.   <cfset count = 1>
  27.  <cfset model_no = "">
  28. <cfset product_type = "">
  29.  <cfset type_hardware_failure = "">
  30.  <cfset pka_serialNo = "">
  31.  <cfset software_hardware = "">
  32.   <cfset description = "">
  33. <cfset resolution = "">
  34.  <cfset resolution_date = "">
  35.   <cfset resolution_verified_by = "">
  36. <cfset verification_date = "">
  37.  <cfset dept_responsibility = "">
  38.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  39.   </cfif>
  40.   <cfif parts.recordcount is 0>
  41. <cfset count1 = 1>
  42.  <cfset hc_partNo = "">
  43.    <cfset part_returned = "">
  44. <cfset defective = "">
  45.    <cfset rma_number = "">
  46.    <cfoutput><cfinclude template="parts.cfm"></cfoutput>
  47.     </cfif>

Thank you,
Rach
Nov 28 '08 #415
acoder
16,027 Expert Mod 8TB
Not quite. The parts code from lines 12-20 and 40-47 would go inside serialpartsdisplay.cfm, probably at the end of it.
Nov 28 '08 #416
bonneylake
769 512MB
Hey Acoder,

I tried putting it at the end an it didn't work. An i tried putting it in the following place below an it had a fit about the cfoutput. any ideas on where to put it?
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="getparts" dbtype="query" >
  2. SELECT *
  3. FROM parts
  4. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  5. cfsqltype="cf_sql_char" maxLength="20">
  6. </cfquery>
  7. <cfset count1 = 0>
  8. <!---<cfif serial.recordcount is 0>--->
  9. <cfloop query="getparts">
  10. <cfset count1 = count1 + 1>
  11.  
  12. Tried to put it here
  13.  
  14. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  15. </cfloop>
here is what i have on the serialpartsdisplay.cfm.

Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4. <cfoutput>
  5. <div id="dynamic#count#Input"> 
  6. <table class="zpExpandedTable" id="modeltable"> 
  7. <th class="sectiontitletick" colspan="7">
  8. Serial Information #count# </th>
  9. <tr>
  10. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  11. </td>
  12. <td>
  13. <select name="modelno_#count#">
  14. <option value="">Make A Selection</option>
  15. <cfloop query="models">
  16. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  17. </cfloop> 
  18. </select></td>
  19. <td>
  20. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  21. </td>
  22. <td>
  23. <select name="producttype_#count#">
  24. <option value="" selected>No Choice</option>
  25. <cfloop query="getProdType">
  26. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  27. </cfloop>
  28. </select>
  29. </td>
  30. <td class="red">
  31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  32. </td>
  33. <td>
  34.  
  35. <select name="hardwarefailure_#count#">
  36. <option value="" selected>Make A Selection</option>
  37. <cfloop query="getHardwareFail">
  38. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  39. </cfloop>
  40. </select>
  41. </td>
  42. </tr>
  43. <table>
  44.  
  45. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  46. <table class="zpExpandedTable" id="modeltable">
  47. <tr>
  48. <td id="paddingformultitop">
  49. Serial Number:&nbsp;&nbsp;
  50. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  51. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  52. <select name="softhardware_#count#">
  53. <option value="" selected>No Choice</option>
  54. <cfloop query="getSoftHard">
  55. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  56. </cfloop>
  57. </select>
  58.  
  59. </td>
  60. </tr>
  61. </table>
  62.  
  63. <!--- Shows what was previously entered for Description ---> 
  64.  
  65.  <cfquery name="getnotes" dbtype="query" >
  66. SELECT *
  67. FROM notes
  68. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  69. cfsqltype="cf_sql_char" maxLength="20">
  70. </cfquery>
  71. <cfloop query="getnotes">
  72.  
  73. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  74. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  75. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  76. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  77. <tr><td id="paddingformutli">
  78. Previously Submitted Descriptions:</td><td id="paddingformutli">
  79. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  80. <cfloop query="getnotes">
  81. Added By: #fk_addedBy# <br/>
  82. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  83. #description#
  84. <div id="line"></div>
  85. </cfloop></div></td>
  86.  
  87. </tr>
  88. </table>
  89. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  90. <tr>
  91. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  92. <td id="paddingformutli">
  93. Description:&nbsp;&nbsp;
  94. </td>
  95. <td class="descriptionmoveinmulti">
  96.  
  97. ( You may enter up to 1000 characters. )
  98. <br>
  99. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  100.  
  101. </td>
  102. </tr>
  103. </table>
  104. <!---Shows what was previously entered for Resolution ---> 
  105.  
  106. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  107. <tr>
  108. <td id="paddingformutli">
  109. Resolution:&nbsp;&nbsp;
  110. </td>
  111. <td class="resolutionmoveinmulti">
  112. ( You may enter up to 1500 characters. )
  113. <br>
  114. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  115. </td>
  116. </tr>
  117. </table>
  118.  
  119. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  120.  
  121. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  122. <tr>
  123. <td id="paddingformultitop">
  124. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  125. </td>
  126. <td>
  127. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  128. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  129. <input type="checkbox" name="currentdateresol_#count#" 
  130. onClick="resdate_#count#.value=fill_date()">
  131. </td>
  132. <td>
  133. Resolution Verified as effective by:&nbsp;&nbsp;
  134. </td>
  135. <td>
  136. <select name="resvertified_#count#">
  137. <option value="" selected>Make A Selection</option>
  138. <cfloop query="gettech">
  139. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  140. selected</cfif>>#fname# #lname#</option>
  141. </cfloop>
  142. </select>
  143. </td>
  144. </tr>
  145. </table>
  146. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  147. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  148. <tr>
  149. <td id="paddingformultitop">
  150. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  151. </td>
  152. <td class="vertificationmoveinmulti">
  153. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  154. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  155. <input type="checkbox" name="currentdatevert_#count#" 
  156. onClick="vertifidate_#count#.value=fill_date()">
  157.  
  158. </td>
  159. </tr>
  160. </table>
  161.  
  162. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  163. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  164. <tr>
  165. <td class="red" id="paddingformultitop">
  166. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  167. <select name="deptvendor_#count#">
  168. <option value="" selected>Make A Selection</option>
  169. <cfloop query="getDeptVendor">
  170. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  171. </cfloop>
  172. </select>
  173. </td>
  174. </tr>
  175. </table>
  176. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  177.  
  178.  
  179.  
  180. <!--- Adds Delete to every ticket  --->
  181. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  182. <tr>
  183. <td>
  184. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  185. </td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  190. </td>
  191. </tr>
  192. </table>
  193.  
  194.  
  195. <!---Shows what was previously entered into parts table--->
  196. <!---dbtype="query"--->
  197.  
  198.  
  199. <cfquery name="getparts" dbtype="query" >
  200. SELECT *
  201. FROM parts
  202. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  203. cfsqltype="cf_sql_char" maxLength="20">
  204. </cfquery>
  205. <cfset count1 = 0>
  206. <!---<cfif serial.recordcount is 0>--->
  207. <cfloop query="getparts">
  208. <cfset count1 = count1 + 1>
  209. <!---The template is where most of the parts section is held--->
  210. <!---<cfinclude template="partsdisplay.cfm">--->
  211. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  212. </cfloop>
  213. </div>
  214. <!---this one makes it so you can add a part to a previously submitted serial--->
  215. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  216. </cfoutput>
Thank you,
Rach
Dec 1 '08 #417
acoder
16,027 Expert Mod 8TB
Since this would be inside a cfoutput query, change the cfoutput in parts to cfloop.
Dec 1 '08 #418
bonneylake
769 512MB
Hey Acoder,

I tried the following but it still didn't work.i changed the last cftemplate from cfoutput to cfloop because it has having problems being inside another cfoutput. But the thing is the parts section does not come up. Any ideas?

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="getparts" dbtype="query" >
  2. SELECT *
  3. FROM parts
  4. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  5. cfsqltype="cf_sql_char" maxLength="20">
  6. </cfquery>
  7. <cfset count1 = 0>
  8. <!---<cfif serial.recordcount is 0>--->
  9. <cfloop query="getparts">
  10. <cfset count1 = count1 + 1>
  11. <!---The template is where most of the parts section is held--->
  12. <!---<cfinclude template="partsdisplay.cfm">--->
  13. <cfset count1 = 0>
  14. <cfloop query="getparts">
  15. <cfset count1 = count1 + 1>
  16. <cfset hc_partNo = #hc_partNo#>
  17. <cfset part_returned = #part_returned#>
  18. <cfset defective = #defective#>
  19. <cfset rma_number = #rma_number#>
  20. <cfinclude template="partsdisplay.cfm">
  21.    </cfloop>
  22.  <cfif getparts.recordcount is 0>
  23.  <cfset count1 = 1>
  24. <cfset hc_partNo = "">
  25. <cfset part_returned = "">
  26. <cfset defective = "">
  27. <cfset rma_number = "">
  28.    <cfloop query="getparts"><cfinclude template="partsdisplay.cfm"></cfloop>
  29.  </cfif>
  30. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  31. </cfloop>
Thank you,
Rach
Dec 1 '08 #419
acoder
16,027 Expert Mod 8TB
You don't need the cfloop tag on line 9 and the cfset on line 10. Neither do you need the ending cfloop on line 31. You also don't need the cfloop tags on line 28. On line 30, the input hidden field will probably be in the partsdisplay.cfm template, so you can remove that line too.
Dec 1 '08 #420
bonneylake
769 512MB
Hey Acoder,

I don't have the hidden input field in the partsdisplay.cfm page because it comes after the parts div. Should i add it to partsdisplay.cfm? i tried the following below but it didn't work. Didn't tell me the pacific problem just didn't work. An i tried moving the hidden field from the serialpartsdisplay.cfm to partsdisplay.cfm an that didn't seem to make a difference no matter where it was.

here is what i got in full on serialpartsdisplay.cfm page is this correct?
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="getparts" dbtype="query" >
  2. SELECT *
  3. FROM parts
  4. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  5. cfsqltype="cf_sql_char" maxLength="20">
  6. </cfquery>
  7. <cfset count1 = 0>
  8. <cfloop query="getparts">
  9. <cfset count1 = count1 + 1>
  10. <cfset hc_partNo = #hc_partNo#>
  11. <cfset part_returned = #part_returned#>
  12. <cfset defective = #defective#>
  13. <cfset rma_number = #rma_number#>
  14. <cfinclude template="partsdisplay.cfm">
  15.    </cfloop>
  16.    <cfif getparts.recordcount is 0>
  17.  <cfset count1 = 1>
  18. <cfset hc_partNo = "">
  19. <cfset part_returned = "">
  20. <cfset defective = ""> 
  21. <cfset rma_number = "">
  22.   <cfinclude template="partsdisplay.cfm">
  23.  </cfif>
Thank you,
Rach
Dec 1 '08 #421
acoder
16,027 Expert Mod 8TB
What have you got in partsdisplay.cfm now? Were you not using parts.cfm earlier?
Dec 1 '08 #422
bonneylake
769 512MB
Hey Acoder,

i changed the file name from parts.cfm to partsdisplay.cfm just so i would understand better what it does. But here is what i got in partsdisplay.cfm now.
Expand|Select|Wrap|Line Numbers
  1. <cfoutput>
  2. <div id="part#count1#Name#count#">
  3. <!---<cfset partliststr = "">
  4. <cfloop from="1" to="#count1#" index="pl">
  5. <cfset partliststr = partliststr & #pl# & ",">
  6. </cfloop>
  7.  
  8. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  9. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  10.  
  11. <!---THIS IS THE PARTS SECTION--->
  12.  
  13. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  14.  
  15. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  16. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  17. <tr>
  18. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  19. <td>
  20. Parts been returned*
  21. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  22. </td>
  23. <td>
  24. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  25. </td>
  26. </tr>
  27. </table>
  28. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  29.  
  30.  
  31. <!--- Shows what was previously entered for RMA Data Only  --->
  32. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  33. <tr>
  34. <td id="paddingformultitop">
  35. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  36. </td>
  37. <td class="rmanmoveinmulti">
  38. ( You may enter up to 1000 characters. )
  39. <br/>
  40. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  41. </tr>
  42. </table>
  43.  
  44.  
  45. <!--- Adds Delete to every ticket  --->
  46. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  47. <tr>
  48. <td>
  49. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  50. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
  51. </td>
  52. </td>
  53. </tr>
  54. </table>
  55. </div>
  56.  
  57. </cfoutput>
Thank you :),
Rach
Dec 1 '08 #423
acoder
16,027 Expert Mod 8TB
You don't need cfoutput in there because it's already contained within cfoutput tags where it's included.
Dec 1 '08 #424
bonneylake
769 512MB
Hey Acoder,

Taking out the cfoutput tags helped an didn't help. The parts section shows up now. But if a part was or was not filled out it does not display what is suppose to be in there it instead just displays the value for the field an for the count, it displays the value #count# instead of the number.Any ideas?

Thank you,
Rach
Dec 1 '08 #425
acoder
16,027 Expert Mod 8TB
What could probably solve all this is to only put cfoutput where it's needed and not around a whole page of code. So remove the cfoutput at the beginning and end of serialpartsdisplay.cfm and put it around each Coldfusion variable not in a Coldfusion tag.
Dec 1 '08 #426
bonneylake
769 512MB
Hey Acoder,

are you meaning to do something like this? because i tried it an it wont allow me to add or remove parts. an also thought of a question. The way we are doing if, if there are serials with no parts applied to it will it add a blank part to them as well instead of just when there is a blank serial?
an if it will is there a way to make a blank parts come up only when a serial is not filled in?
Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4. <cfoutput>
  5. <div id="dynamic#count#Input"> </cfoutput>
  6. <table class="zpExpandedTable" id="modeltable"> 
  7. <th class="sectiontitletick" colspan="7">
  8. Serial Information<cfoutput> #count# </cfoutput></th>
  9. <tr>
  10. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  11. </td>
  12. <td>
  13. <cfoutput>
  14. <select name="modelno_#count#">
  15. <option value="">Make A Selection</option>
  16. <cfloop query="models">
  17. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  18. </cfloop> 
  19. </select></cfoutput></td>
  20. <td>
  21. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  22. </td>
  23. <td>
  24. <cfoutput>
  25. <select name="producttype_#count#">
  26. <option value="" selected>No Choice</option>
  27. <cfloop query="getProdType">
  28. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  29. </cfloop>
  30. </select></cfoutput>
  31. </td>
  32. <td class="red">
  33. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  34. </td>
  35. <td>
  36. <cfoutput>
  37. <select name="hardwarefailure_#count#">
  38. <option value="" selected>Make A Selection</option>
  39. <cfloop query="getHardwareFail">
  40. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  41. </cfloop>
  42. </select></cfoutput>
  43. </td>
  44. </tr>
  45. <table>
  46.  
  47. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  48. <table class="zpExpandedTable" id="modeltable">
  49. <tr>
  50. <td id="paddingformultitop">
  51. <cfoutput>
  52. Serial Number:&nbsp;&nbsp;
  53. <input type="text" name="serialnum_#count#" value="#pka_serialNo#"></cfoutput>
  54. <cfoutput>&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  55. <select name="softhardware_#count#">
  56. <option value="" selected>No Choice</option>
  57. <cfloop query="getSoftHard">
  58. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  59. </cfloop>
  60. </select>
  61. </cfoutput>
  62. </td>
  63. </tr>
  64. </table>
  65.  
  66. <!--- Shows what was previously entered for Description ---> 
  67.  
  68.  <cfquery name="getnotes" dbtype="query" >
  69. SELECT *
  70. FROM notes
  71. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  72. cfsqltype="cf_sql_char" maxLength="20">
  73. </cfquery>
  74. <cfloop query="getnotes">
  75.  
  76. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  77. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  78. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  79. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  80. <tr><td id="paddingformutli">
  81. Previously Submitted Descriptions:</td><td id="paddingformutli">
  82. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  83. <cfloop query="getnotes">
  84. Added By: #fk_addedBy# <br/>
  85. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  86. #description#
  87. <div id="line"></div>
  88. </cfloop></div></td>
  89.  
  90. </tr>
  91. </table>
  92. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  93. <tr>
  94. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  95. <td id="paddingformutli">
  96. Description:&nbsp;&nbsp;
  97. </td>
  98. <td class="descriptionmoveinmulti">
  99.  
  100. ( You may enter up to 1000 characters. )
  101. <br><cfoutput>
  102. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea></cfoutput>
  103.  
  104. </td>
  105. </tr>
  106. </table>
  107. <!---Shows what was previously entered for Resolution ---> 
  108.  
  109. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  110. <tr>
  111. <td id="paddingformutli">
  112. Resolution:&nbsp;&nbsp;
  113. </td>
  114. <td class="resolutionmoveinmulti">
  115. ( You may enter up to 1500 characters. )
  116. <br>
  117. <cfoutput>
  118. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea></cfoutput>
  119. </td>
  120. </tr>
  121. </table>
  122.  
  123. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  124.  
  125. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  126. <tr>
  127. <td id="paddingformultitop">
  128. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  129. </td>
  130. <td>
  131. <cfoutput>
  132. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  133. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  134. <input type="checkbox" name="currentdateresol_#count#" 
  135. onClick="resdate_#count#.value=fill_date()"></cfoutput>
  136. </td>
  137. <td>
  138. Resolution Verified as effective by:&nbsp;&nbsp;
  139. </td>
  140. <td>
  141. <cfoutput>
  142. <select name="resvertified_#count#">
  143. <option value="" selected>Make A Selection</option>
  144. <cfloop query="gettech">
  145. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  146. selected</cfif>>#fname# #lname#</option>
  147. </cfloop>
  148. </select>
  149. </cfoutput>
  150. </td>
  151. </tr>
  152. </table>
  153. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  154. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  155. <tr>
  156. <td id="paddingformultitop">
  157. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  158. </td>
  159. <td class="vertificationmoveinmulti">
  160. <cfoutput>
  161. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  162. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  163. <input type="checkbox" name="currentdatevert_#count#" 
  164. onClick="vertifidate_#count#.value=fill_date()">
  165. </cfoutput>
  166. </td>
  167. </tr>
  168. </table>
  169.  
  170. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  171. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  172. <tr>
  173. <td class="red" id="paddingformultitop">
  174. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  175. <cfoutput>
  176. <select name="deptvendor_#count#">
  177. <option value="" selected>Make A Selection</option>
  178. <cfloop query="getDeptVendor">
  179. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  180. </cfloop>
  181. </select>
  182. </cfoutput>
  183. </td>
  184. </tr>
  185. </table>
  186. <cfoutput>
  187. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  188. </cfoutput>
  189.  
  190.  
  191. <!--- Adds Delete to every ticket  --->
  192. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  193. <tr>
  194. <td>
  195. <cfoutput>
  196. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  197. </cfoutput>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td>
  202. <cfoutput>
  203. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  204. </cfoutput>
  205. </td>
  206. </tr>
  207. </table>
  208.  
  209.  
  210. <!---Shows what was previously entered into parts table--->
  211. <!---dbtype="query"--->
  212.  
  213.  
  214. <cfquery name="getparts" dbtype="query" >
  215. SELECT *
  216. FROM parts
  217. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  218. cfsqltype="cf_sql_char" maxLength="20">
  219. </cfquery>
  220. <!---<cfset count1 = 0>--->
  221. <!---<cfif serial.recordcount is 0>--->
  222. <!---<cfloop query="getparts">
  223. <cfset count1 = count1 + 1>--->
  224. <!---The template is where most of the parts section is held--->
  225. <!---<cfinclude template="partsdisplay.cfm">--->
  226.  
  227.  
  228. <cfset count1 = 0>
  229.  
  230. <cfoutput query="getparts">
  231. <cfset count1 = count1 + 1>
  232. <cfset hc_partNo = #hc_partNo#>
  233. <cfset part_returned = #part_returned#>
  234. <cfset defective = #defective#>
  235. <cfset rma_number = #rma_number#>
  236. <cfinclude template="partsdisplay.cfm">
  237. </cfoutput>
  238.    <cfif getparts.recordcount is 0>
  239.  <cfset count1 = 1>
  240. <cfset hc_partNo = "">
  241. <cfset part_returned = "">
  242. <cfset defective = ""> 
  243. <cfset rma_number = "">
  244.   <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
  245.  </cfif>
  246.  
  247.  
  248. <cfoutput><input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/></cfoutput>
  249. <!---</cfloop>
  250. --->
  251.  
  252. </div>
  253. <!---this one makes it so you can add a part to a previously submitted serial--->
  254. <!---<input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />--->
  255.  
Thank you,
Rach
Dec 1 '08 #427
acoder
16,027 Expert Mod 8TB
@bonneylake
What happens? Do you get an error? The general idea is correct, though you could change where you put the cfoutput.
an also thought of a question. The way we are doing if, if there are serials with no parts applied to it will it add a blank part to them as well instead of just when there is a blank serial?
an if it will is there a way to make a blank parts come up only when a serial is not filled in?
Yes, add a check for when serial count is 0 too when displaying a blank part.
Dec 2 '08 #428
bonneylake
769 512MB
Hey Acoder,

Well i discovered something weird today. I had original made a copy of serialpartsdisplay.cfm to apply the new idea we had where we wrapped each seperate section in cfoutput. Anyway when i went to look this morning with the old serialpartdisplay.cfm I clicked on add part an it seemed to be counting right except for the first part displayed. So i I ended up wrapping only the required sections in parts and that seemed to work some what. however, for some reason i can not wrap the following 2 things in cfoutput or i get errors and i am not able to delete the first part.

Expand|Select|Wrap|Line Numbers
  1. <div id="part#count1#Name#count#">
  2. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
this is what i tried in full on the partsdisplay.cfm page

Expand|Select|Wrap|Line Numbers
  1. <div id="part#count1#Name#count#">
  2. <!---<cfset partliststr = "">
  3. <cfloop from="1" to="#count1#" index="pl">
  4. <cfset partliststr = partliststr & #pl# & ",">
  5. </cfloop>
  6.  
  7. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  8. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  9.  
  10. <!---THIS IS THE PARTS SECTION--->
  11.  
  12. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  13.  
  14. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  15. <th class="sectiontitle" colspan="7"><cfoutput>Parts Information #count1# Serial Information #count#</cfoutput></th>
  16. <tr>
  17. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<cfoutput><input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></cfoutput></td>
  18. <td>
  19. Parts been returned*
  20. <cfoutput><input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/></cfoutput>
  21. </td>
  22. <td>
  23. <td class="indent">Defective<cfoutput><input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></cfoutput></td>
  24. </td>
  25. </tr>
  26. </table>
  27. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  28.  
  29.  
  30. <!--- Shows what was previously entered for RMA Data Only  --->
  31. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  32. <tr>
  33. <td id="paddingformultitop">
  34. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  35. </td>
  36. <td class="rmanmoveinmulti">
  37. ( You may enter up to 1000 characters. )
  38. <br/>
  39. <cfoutput>
  40. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></cfoutput></td>
  41. </tr>
  42. </table>
  43.  
  44.  
  45. <!--- Adds Delete to every ticket  --->
  46. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  47. <tr>
  48. <td>
  49. <cfoutput>
  50. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  51. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a></cfoutput>
  52. </td>
  53. </td>
  54. </tr>
  55. </table>
  56.  
  57. </div>
  58. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>--->
an how would i add a check for the serial count is 0?because i got on cticketpage2edit.cfm the following an it does the serial is 0 but i don't know how to make it where if a serial is empty is only when a part will appear.

Expand|Select|Wrap|Line Numbers
  1. <cfset count = 0>
  2.  <cfoutput query="serial">
  3.  <cfset count = count + 1>
  4.  <cfset model_no = #model_no#>
  5.  <cfset product_type = #product_type#>
  6.  <cfset type_hardware_failure = #type_hardware_failure#>
  7.   <cfset pka_serialNo = #pka_serialNo#>
  8.  <cfset software_hardware = #software_hardware#>
  9.   <cfset resolution = #resolution#>
  10.  <cfset resolution_date = #resolution_date#>
  11.  <cfset resolution_verified_by = #resolution_verified_by#>
  12.   <cfset verification_date = #verification_date#>
  13.  <cfset dept_responsibility = #dept_responsibility#>
  14.  <cfinclude template="serialpartsdisplay.cfm">
  15.    </cfoutput>
  16.  
  17. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  18.  <cfif serial.recordcount is 0>
  19.  <cfset count = 1>
  20.  <cfset model_no = "">
  21.  <cfset product_type = "">
  22.  <cfset type_hardware_failure = "">
  23.  <cfset pka_serialNo = "">
  24.  <cfset software_hardware = "">
  25.  <cfset resolution = "">
  26.  <cfset resolution_date = "">
  27.  <cfset resolution_verified_by = "">
  28.  <cfset verification_date = "">
  29.  <cfset dept_responsibility = "">
  30.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  31.  </cfif>
  32.  
Thank you,
Rach
Dec 2 '08 #429
acoder
16,027 Expert Mod 8TB
Have you got the partsdisplay.cfm include file wrapped in cfoutput in serialpartsdisplay.cfm?

For the serial count, when checking parts count just add a check for serial count too, e.g.
Expand|Select|Wrap|Line Numbers
  1. <cfif serial.recordcount is 0 and parts.recordcount is 0>
Dec 2 '08 #430
bonneylake
769 512MB
Hey Acoder,

The checking parts count worked beautiful. But i can still not get the parts. I have the
parts wrapped as below

Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="getparts">
  2. <cfset count1 = count1 + 1>
  3. <cfset hc_partNo = #hc_partNo#>
  4. <cfset part_returned = #part_returned#>
  5. <cfset defective = #defective#>
  6. <cfset rma_number = #rma_number#>
  7. <cfinclude template="partsdisplay.cfm">
  8.    </cfoutput>
  9.    <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  10.  <cfset count1 = 1>
  11. <cfset hc_partNo = "">
  12. <cfset part_returned = "">
  13. <cfset defective = ""> 
  14. <cfset rma_number = "">
  15.   <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
  16.  </cfif>
  17.  
an then inside the partsdisplay.cfm is in post 429.The problem is witht he div in partsdisplay.cfm. When i go an look using firebug it is not counting or doing anything. If i wrap the div itself in cfoutput it does not work an i get an error. Could it be possible that if i took the beginning div an the end div an put it in serialpartsdisplay.cfm but leave everything between the div on partsdisplay.cfm that it might work?

Thank you,
Rach
Dec 2 '08 #431
bonneylake
769 512MB
Hey Acoder,

i got the parts working sorta so ignore post 431. I was able to do the following in partsdisplay.cfm an this allowed me to remove the first part added
Expand|Select|Wrap|Line Numbers
  1. <cfoutput><div id="part#count1#Name#count#"></cfoutput>.
However, i am noticing another problems. for some reason if i do not add a part an i go an submit on the print ticket page it shows the following parts information 0 serial 1.. an it does it to every part i add as well. there is always a 0 at the beginning even if i only add part 2 and 4 it will display 0,2,4.

I am also noticing if i add 2 parts to one serial it will only display one part instead of all the parts added.i know its because of the line below. I tried to wrap the whole line in cfoutput but it wouldn't let me
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
here is what i got on partsdisplay.cfm


Expand|Select|Wrap|Line Numbers
  1. <cfoutput><div id="part#count1#Name#count#"></cfoutput>
  2. <!---<cfset partliststr = "">
  3. <cfloop from="1" to="#count1#" index="pl">
  4. <cfset partliststr = partliststr & #pl# & ",">
  5. </cfloop>
  6.  
  7. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  8. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  9.  
  10. <!---THIS IS THE PARTS SECTION--->
  11.  
  12. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  13.  
  14. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  15. <th class="sectiontitle" colspan="7"><cfoutput>Parts Information #count1# Serial Information #count#</cfoutput></th>
  16. <tr>
  17. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<cfoutput><input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></cfoutput></td>
  18. <td>
  19. Parts been returned*
  20. <cfoutput><input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/></cfoutput>
  21. </td>
  22. <td>
  23. <td class="indent">Defective<cfoutput><input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></cfoutput></td>
  24. </td>
  25. </tr>
  26. </table>
  27. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  28.  
  29.  
  30. <!--- Shows what was previously entered for RMA Data Only  --->
  31. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  32. <tr>
  33. <td id="paddingformultitop">
  34. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  35. </td>
  36. <td class="rmanmoveinmulti">
  37. ( You may enter up to 1000 characters. )
  38. <br/>
  39. <cfoutput>
  40. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></cfoutput></td>
  41. </tr>
  42. </table>
  43.  
  44.  
  45. <!--- Adds Delete to every ticket  --->
  46. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  47. <tr>
  48. <td>
  49. <cfoutput>
  50. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  51. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a></cfoutput>
  52. </td>
  53. </td>
  54. </tr>
  55. </table>
  56.  
  57. </div>
  58. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>--->
  59.  




Thank you,
Rach
Dec 2 '08 #432
acoder
16,027 Expert Mod 8TB
You've got cfoutput outside partsdisplay.cfm, so you shouldn't require any cfoutput tags in the file.
Dec 2 '08 #433
bonneylake
769 512MB
Hey Acoder,


I tried to not having any cfoutput tags in partsdisplay.cfm. But when the first part loads (with no serial) it says parts information #count# an it does it for everything else in the file for some reason if i don't have cfoutput tags in there. With it, it does it correct except that one line mentioned above. but other wise for the first part that loads with no serial it wont work correctly.

here is what i got on serialpartsdisplay.cfm for the parts section in it

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="getparts" dbtype="query" >
  2. SELECT *
  3. FROM parts
  4. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  5. cfsqltype="cf_sql_char" maxLength="20">
  6. </cfquery>
  7. <cfset count1 = 0>
  8. <!---<cfif serial.recordcount is 0>--->
  9. <!---<cfloop query="getparts">
  10. <cfset count1 = count1 + 1>--->
  11.  
  12.  
  13.  
  14. <!---The template is where most of the parts section is held--->
  15. <!---<cfinclude template="partsdisplay.cfm">--->
  16. <!---<cfset count1 = 0>--->
  17. <cfoutput query="getparts">
  18. <cfset count1 = count1 + 1>
  19. <cfset hc_partNo = #hc_partNo#>
  20. <cfset part_returned = #part_returned#>
  21. <cfset defective = #defective#>
  22. <cfset rma_number = #rma_number#>
  23. <cfinclude template="partsdisplay.cfm">
  24.    </cfoutput>
  25.    <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  26.  <cfset count1 = 1>
  27. <cfset hc_partNo = "">
  28. <cfset part_returned = "">
  29. <cfset defective = ""> 
  30. <cfset rma_number = "">
  31.   <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
  32.  </cfif>
  33.  
  34.  <cfoutput>
  35. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  36. <!---</cfloop>
  37. --->
  38.  </cfoutput>
Thank you,
Rach
Dec 2 '08 #434
acoder
16,027 Expert Mod 8TB
Is serialpartsdisplay.cfm in cfoutput tags? If it is, change the cfoutput query to cfloop and remove the cfoutput tags.
Dec 2 '08 #435
bonneylake
769 512MB
Hey Acoder,

When i did that it now does not display serial at all unless click add button an then the count is messed up here is what i got on serialpartsdisplay.cfm. But i am wondering did i need to change cticketpage2edit.cfm to cflop instead of serialpartsdisplay.cfm?

here is what i got on serialpartsdisplay.cfm

Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4. <cfloop query="serial">
  5. <div id="dynamic#count#Input"> 
  6. <table class="zpExpandedTable" id="modeltable"> 
  7. <th class="sectiontitletick" colspan="7">
  8. Serial Information #count# </th>
  9. <tr>
  10. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  11. </td>
  12. <td>
  13. <select name="modelno_#count#">
  14. <option value="">Make A Selection</option>
  15. <cfloop query="models">
  16. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  17. </cfloop> 
  18. </select></td>
  19. <td>
  20. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  21. </td>
  22. <td>
  23. <select name="producttype_#count#">
  24. <option value="" selected>No Choice</option>
  25. <cfloop query="getProdType">
  26. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  27. </cfloop>
  28. </select>
  29. </td>
  30. <td class="red">
  31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  32. </td>
  33. <td>
  34.  
  35. <select name="hardwarefailure_#count#">
  36. <option value="" selected>Make A Selection</option>
  37. <cfloop query="getHardwareFail">
  38. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  39. </cfloop>
  40. </select>
  41. </td>
  42. </tr>
  43. <table>
  44.  
  45. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  46. <table class="zpExpandedTable" id="modeltable">
  47. <tr>
  48. <td id="paddingformultitop">
  49. Serial Number:&nbsp;&nbsp;
  50. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  51. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  52. <select name="softhardware_#count#">
  53. <option value="" selected>No Choice</option>
  54. <cfloop query="getSoftHard">
  55. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  56. </cfloop>
  57. </select>
  58.  
  59. </td>
  60. </tr>
  61. </table>
  62.  
  63. <!--- Shows what was previously entered for Description ---> 
  64.  
  65.  <cfquery name="getnotes" dbtype="query" >
  66. SELECT *
  67. FROM notes
  68. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  69. cfsqltype="cf_sql_char" maxLength="20">
  70. </cfquery>
  71. <cfloop query="getnotes">
  72.  
  73. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  74. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  75. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  76. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  77. <tr><td id="paddingformutli">
  78. Previously Submitted Descriptions:</td><td id="paddingformutli">
  79. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  80. <cfloop query="getnotes">
  81. Added By: #fk_addedBy# <br/>
  82. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  83. #description#
  84. <div id="line"></div>
  85. </cfloop></div></td>
  86.  
  87. </tr>
  88. </table>
  89. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  90. <tr>
  91. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  92. <td id="paddingformutli">
  93. Description:&nbsp;&nbsp;
  94. </td>
  95. <td class="descriptionmoveinmulti">
  96.  
  97. ( You may enter up to 1000 characters. )
  98. <br>
  99. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  100.  
  101. </td>
  102. </tr>
  103. </table>
  104. <!---Shows what was previously entered for Resolution ---> 
  105.  
  106. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  107. <tr>
  108. <td id="paddingformutli">
  109. Resolution:&nbsp;&nbsp;
  110. </td>
  111. <td class="resolutionmoveinmulti">
  112. ( You may enter up to 1500 characters. )
  113. <br>
  114. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  115. </td>
  116. </tr>
  117. </table>
  118.  
  119. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  120.  
  121. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  122. <tr>
  123. <td id="paddingformultitop">
  124. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  125. </td>
  126. <td>
  127. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  128. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  129. <input type="checkbox" name="currentdateresol_#count#" 
  130. onClick="resdate_#count#.value=fill_date()">
  131. </td>
  132. <td>
  133. Resolution Verified as effective by:&nbsp;&nbsp;
  134. </td>
  135. <td>
  136. <select name="resvertified_#count#">
  137. <option value="" selected>Make A Selection</option>
  138. <cfloop query="gettech">
  139. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  140. selected</cfif>>#fname# #lname#</option>
  141. </cfloop>
  142. </select>
  143. </td>
  144. </tr>
  145. </table>
  146. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  147. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  148. <tr>
  149. <td id="paddingformultitop">
  150. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  151. </td>
  152. <td class="vertificationmoveinmulti">
  153. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  154. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  155. <input type="checkbox" name="currentdatevert_#count#" 
  156. onClick="vertifidate_#count#.value=fill_date()">
  157.  
  158. </td>
  159. </tr>
  160. </table>
  161.  
  162. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  163. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  164. <tr>
  165. <td class="red" id="paddingformultitop">
  166. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  167. <select name="deptvendor_#count#">
  168. <option value="" selected>Make A Selection</option>
  169. <cfloop query="getDeptVendor">
  170. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  171. </cfloop>
  172. </select>
  173. </td>
  174. </tr>
  175. </table>
  176. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  177.  
  178.  
  179.  
  180. <!--- Adds Delete to every ticket  --->
  181. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  182. <tr>
  183. <td>
  184. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  185. </td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  190. </td>
  191. </tr>
  192. </table>
  193.  
  194.  
  195. <!---Shows what was previously entered into parts table--->
  196. <!---dbtype="query"--->
  197.  
  198.  
  199. <cfquery name="getparts" dbtype="query" >
  200. SELECT *
  201. FROM parts
  202. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  203. cfsqltype="cf_sql_char" maxLength="20">
  204. </cfquery>
  205. <cfset count1 = 0>
  206. <!---<cfif serial.recordcount is 0>--->
  207. <!---<cfloop query="getparts">
  208. <cfset count1 = count1 + 1>--->
  209.  
  210.  
  211.  
  212. <!---The template is where most of the parts section is held--->
  213. <!---<cfinclude template="partsdisplay.cfm">--->
  214. <!---<cfset count1 = 0>--->
  215. <cfloop query="getparts">
  216. <cfset count1 = count1 + 1>
  217. <cfset hc_partNo = #hc_partNo#>
  218. <cfset part_returned = #part_returned#>
  219. <cfset defective = #defective#>
  220. <cfset rma_number = #rma_number#>
  221. <cfinclude template="partsdisplay.cfm">
  222.    </cfloop>
  223.    <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  224.  <cfset count1 = 1>
  225. <cfset hc_partNo = "">
  226. <cfset part_returned = "">
  227. <cfset defective = ""> 
  228. <cfset rma_number = "">
  229.   <cfinclude template="partsdisplay.cfm">
  230.  </cfif>
  231.  
  232.  
  233. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  234. <!---</cfloop>
  235. --->
  236.  
  237. </div>
  238. <!---this one makes it so you can add a part to a previously submitted serial--->
  239.  
  240. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  241. </cfloop>
  242.  
here is what i got on cticketpage2edit.cfm

Expand|Select|Wrap|Line Numbers
  1.   <div id="dynamicInput"> 
  2.      <!--- All Ticket Information Appears Here--->
  3.  
  4. <!---If there is a serial it will show it (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  5. <cfset count = 0>
  6.  <cfoutput query="serial">
  7.  <cfset count = count + 1>
  8.  <cfset model_no = #model_no#>
  9.  <cfset product_type = #product_type#>
  10.  <cfset type_hardware_failure = #type_hardware_failure#>
  11.   <cfset pka_serialNo = #pka_serialNo#>
  12.  <cfset software_hardware = #software_hardware#>
  13.   <cfset resolution = #resolution#>
  14.  <cfset resolution_date = #resolution_date#>
  15.  <cfset resolution_verified_by = #resolution_verified_by#>
  16.   <cfset verification_date = #verification_date#>
  17.  <cfset dept_responsibility = #dept_responsibility#>
  18.  <cfinclude template="serialpartsdisplay.cfm">
  19.    </cfoutput>
  20.  
  21. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  22.  <cfif serial.recordcount is 0>
  23.  <cfset count = 1>
  24.  <cfset model_no = "">
  25.  <cfset product_type = "">
  26.  <cfset type_hardware_failure = "">
  27.  <cfset pka_serialNo = "">
  28.  <cfset software_hardware = "">
  29.  <cfset resolution = "">
  30.  <cfset resolution_date = "">
  31.  <cfset resolution_verified_by = "">
  32.  <cfset verification_date = "">
  33.  <cfset dept_responsibility = "">
  34.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  35.  </cfif>
  36.  
  37.  
  38.  
  39.  
  40. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  41. </div>
  42.  
  43.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
Thank you,
Rach
Dec 2 '08 #436
bonneylake
769 512MB
Hey Acoder,

I really can't figure it out. I know it has to do with a cfloop or cfoutput in the wrong place but not sure where. But here is what i got in full on every page

on cticketpage2edit.cfm.
Expand|Select|Wrap|Line Numbers
  1.     <div id="dynamicInput"> 
  2.      <!--- All Ticket Information Appears Here--->
  3.  
  4. <!---If there is a serial it will show it (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  5. <cfset count = 0>
  6.  <cfloop query="serial">
  7.  <cfset count = count + 1>
  8.  <cfset model_no = #model_no#>
  9.  <cfset product_type = #product_type#>
  10.  <cfset type_hardware_failure = #type_hardware_failure#>
  11.   <cfset pka_serialNo = #pka_serialNo#>
  12.  <cfset software_hardware = #software_hardware#>
  13.   <cfset resolution = #resolution#>
  14.  <cfset resolution_date = #resolution_date#>
  15.  <cfset resolution_verified_by = #resolution_verified_by#>
  16.   <cfset verification_date = #verification_date#>
  17.  <cfset dept_responsibility = #dept_responsibility#>
  18.  <cfinclude template="serialpartsdisplay.cfm">
  19.    </cfloop>
  20.  
  21. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  22.  <cfif serial.recordcount is 0>
  23.  <cfset count = 1>
  24.  <cfset model_no = "">
  25.  <cfset product_type = "">
  26.  <cfset type_hardware_failure = "">
  27.  <cfset pka_serialNo = "">
  28.  <cfset software_hardware = "">
  29.  <cfset resolution = "">
  30.  <cfset resolution_date = "">
  31.  <cfset resolution_verified_by = "">
  32.  <cfset verification_date = "">
  33.  <cfset dept_responsibility = "">
  34.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  35.  </cfif>
  36.  
  37. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  38. </div>
  39.  
  40.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >





serialpartsdisplay.cfm-
Expand|Select|Wrap|Line Numbers
  1. <cfoutput>
  2.  
  3. the serials display here
  4.  
  5. <cfquery name="getparts" dbtype="query" >
  6. SELECT *
  7. FROM parts
  8. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  9. cfsqltype="cf_sql_char" maxLength="20">
  10. </cfquery>
  11. <cfset count1 = 0>
  12. <!---<cfif serial.recordcount is 0>--->
  13. <!---<cfloop query="getparts">
  14. <cfset count1 = count1 + 1>--->
  15.  
  16.  
  17.  
  18. <!---The template is where most of the parts section is held--->
  19. <!---<cfinclude template="partsdisplay.cfm">--->
  20. <!---<cfset count1 = 0>--->
  21. <cfloop query="getparts">
  22. <cfset count1 = count1 + 1>
  23. <cfset hc_partNo = #hc_partNo#>
  24. <cfset part_returned = #part_returned#>
  25. <cfset defective = #defective#>
  26. <cfset rma_number = #rma_number#>
  27. <cfinclude template="partsdisplay.cfm">
  28.    </cfloop>
  29.    <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  30.  <cfset count1 = 1>
  31. <cfset hc_partNo = "">
  32. <cfset part_returned = "">
  33. <cfset defective = ""> 
  34. <cfset rma_number = "">
  35. <cfinclude template="partsdisplay.cfm">
  36.  </cfif>
  37.  
  38.  
  39. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  40.  
  41. serials close here
  42.  
  43.  
  44. </cfoutput>
partsdisplay.cfm
Expand|Select|Wrap|Line Numbers
  1. <div id="part#count1#Name#count#">
  2.  
  3. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  4. <!---<cfset partliststr = "">
  5. <cfloop from="1" to="#count1#" index="pl">
  6. <cfset partliststr = partliststr & #pl# & ",">
  7. </cfloop>
  8.  
  9. <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
  10. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
  11.  
  12. <!---THIS IS THE PARTS SECTION--->
  13.  
  14.  
  15.  
  16. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  17. <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
  18. <tr>
  19. <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
  20. <td>
  21. Parts been returned*
  22. <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
  23. </td>
  24. <td>
  25. <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
  26. </td>
  27. </tr>
  28. </table>
  29. <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
  30.  
  31.  
  32. <!--- Shows what was previously entered for RMA Data Only  --->
  33. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  34. <tr>
  35. <td id="paddingformultitop">
  36. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  37. </td>
  38. <td class="rmanmoveinmulti">
  39. ( You may enter up to 1000 characters. )
  40. <br/>
  41.  
  42. <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></td>
  43. </tr>
  44. </table>
  45.  
  46.  
  47. <!--- Adds Delete to every ticket  --->
  48. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  49. <tr>
  50. <td>
  51.  
  52. <input type="button" class="removeticket" value="Remove Parts #count1#" 
  53. onclick="removetheElement('part#count1#Name#count#',#count#,#count#)">
  54. </td>
  55. </td>
  56. </tr>
  57. </table>
  58.  
  59. </div>
Thank you,
Rach
Dec 2 '08 #437
acoder
16,027 Expert Mod 8TB
If you look carefully, you'll notice that you have cfoutput within cfoutput. On the edit page, you've put cfoutput tags around serialpartsdisplay include, then within serialpartsdisplay you have the whole content in cfoutput. What I would suggest for an easy solution here is that you remove the cfoutput tags in serialpartsdisplay and change the cfloop query in the edit page to a cfoutput one.
Dec 3 '08 #438
bonneylake
769 512MB
Hey Acoder,

I tried that but it didn't work. All it does is the same problem i am having with parts which it displays #count# instead of the number an it does it for all fields an it does it with or without a serial filled out. The only way i been able to display serials is by having cfoutput in serialpartsdisplay.cfm. Here is what i tried

on cticketpage2edit.cfm

Expand|Select|Wrap|Line Numbers
  1. <div id="dynamicInput"> 
  2.      <!--- All Ticket Information Appears Here--->
  3.  
  4. <!---If there is a serial it will show it (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  5. <cfset count = 0>
  6.  <cfoutput query="serial">
  7.  <cfset count = count + 1>
  8.  <cfset model_no = #model_no#>
  9.  <cfset product_type = #product_type#>
  10.  <cfset type_hardware_failure = #type_hardware_failure#>
  11.   <cfset pka_serialNo = #pka_serialNo#>
  12.  <cfset software_hardware = #software_hardware#>
  13.   <cfset resolution = #resolution#>
  14.  <cfset resolution_date = #resolution_date#>
  15.  <cfset resolution_verified_by = #resolution_verified_by#>
  16.   <cfset verification_date = #verification_date#>
  17.  <cfset dept_responsibility = #dept_responsibility#>
  18.  <cfinclude template="serialpartsdisplay.cfm">
  19.    </cfoutput>
  20.  
  21. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  22.  <cfif serial.recordcount is 0>
  23.  <cfset count = 1>
  24.  <cfset model_no = "">
  25.  <cfset product_type = "">
  26.  <cfset type_hardware_failure = "">
  27.  <cfset pka_serialNo = "">
  28.  <cfset software_hardware = "">
  29.  <cfset resolution = "">
  30.  <cfset resolution_date = "">
  31.  <cfset resolution_verified_by = "">
  32.  <cfset verification_date = "">
  33.  <cfset dept_responsibility = "">
  34.    <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
  35.  </cfif>
  36.  
  37.  
  38.  
  39.  
  40. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  41. </div>
  42.  
  43.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
serialpartsdisplay.cfm
Expand|Select|Wrap|Line Numbers
  1. <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
  2.  
  3. <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4.  
  5. <div id="dynamic#count#Input"> 
  6. <table class="zpExpandedTable" id="modeltable"> 
  7. <th class="sectiontitletick" colspan="7">
  8. Serial Information #count# </th>
  9. <tr>
  10. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  11. </td>
  12. <td>
  13. <select name="modelno_#count#">
  14. <option value="">Make A Selection</option>
  15. <cfloop query="models">
  16. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  17. </cfloop> 
  18. </select></td>
  19. <td>
  20. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  21. </td>
  22. <td>
  23. <select name="producttype_#count#">
  24. <option value="" selected>No Choice</option>
  25. <cfloop query="getProdType">
  26. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  27. </cfloop>
  28. </select>
  29. </td>
  30. <td class="red">
  31. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  32. </td>
  33. <td>
  34.  
  35. <select name="hardwarefailure_#count#">
  36. <option value="" selected>Make A Selection</option>
  37. <cfloop query="getHardwareFail">
  38. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  39. </cfloop>
  40. </select>
  41. </td>
  42. </tr>
  43. <table>
  44.  
  45. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  46. <table class="zpExpandedTable" id="modeltable">
  47. <tr>
  48. <td id="paddingformultitop">
  49. Serial Number:&nbsp;&nbsp;
  50. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  51. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  52. <select name="softhardware_#count#">
  53. <option value="" selected>No Choice</option>
  54. <cfloop query="getSoftHard">
  55. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  56. </cfloop>
  57. </select>
  58.  
  59. </td>
  60. </tr>
  61. </table>
  62.  
  63. <!--- Shows what was previously entered for Description ---> 
  64.  
  65.  <cfquery name="getnotes" dbtype="query" >
  66. SELECT *
  67. FROM notes
  68. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  69. cfsqltype="cf_sql_char" maxLength="20">
  70. </cfquery>
  71. <cfloop query="getnotes">
  72.  
  73. <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
  74. <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
  75. scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
  76. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  77. <tr><td id="paddingformutli">
  78. Previously Submitted Descriptions:</td><td id="paddingformutli">
  79. <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
  80. <cfloop query="getnotes">
  81. Added By: #fk_addedBy# <br/>
  82. Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
  83. #description#
  84. <div id="line"></div>
  85. </cfloop></div></td>
  86.  
  87. </tr>
  88. </table>
  89. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  90. <tr>
  91. <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
  92. <td id="paddingformutli">
  93. Description:&nbsp;&nbsp;
  94. </td>
  95. <td class="descriptionmoveinmulti">
  96.  
  97. ( You may enter up to 1000 characters. )
  98. <br>
  99. <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
  100.  
  101. </td>
  102. </tr>
  103. </table>
  104. <!---Shows what was previously entered for Resolution ---> 
  105.  
  106. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  107. <tr>
  108. <td id="paddingformutli">
  109. Resolution:&nbsp;&nbsp;
  110. </td>
  111. <td class="resolutionmoveinmulti">
  112. ( You may enter up to 1500 characters. )
  113. <br>
  114. <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  115. </td>
  116. </tr>
  117. </table>
  118.  
  119. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  120.  
  121. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  122. <tr>
  123. <td id="paddingformultitop">
  124. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  125. </td>
  126. <td>
  127. <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  128. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  129. <input type="checkbox" name="currentdateresol_#count#" 
  130. onClick="resdate_#count#.value=fill_date()">
  131. </td>
  132. <td>
  133. Resolution Verified as effective by:&nbsp;&nbsp;
  134. </td>
  135. <td>
  136. <select name="resvertified_#count#">
  137. <option value="" selected>Make A Selection</option>
  138. <cfloop query="gettech">
  139. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>
  140. selected</cfif>>#fname# #lname#</option>
  141. </cfloop>
  142. </select>
  143. </td>
  144. </tr>
  145. </table>
  146. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  147. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  148. <tr>
  149. <td id="paddingformultitop">
  150. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  151. </td>
  152. <td class="vertificationmoveinmulti">
  153. <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&nbsp;&nbsp;
  154. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  155. <input type="checkbox" name="currentdatevert_#count#" 
  156. onClick="vertifidate_#count#.value=fill_date()">
  157.  
  158. </td>
  159. </tr>
  160. </table>
  161.  
  162. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  163. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  164. <tr>
  165. <td class="red" id="paddingformultitop">
  166. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  167. <select name="deptvendor_#count#">
  168. <option value="" selected>Make A Selection</option>
  169. <cfloop query="getDeptVendor">
  170. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  171. </cfloop>
  172. </select>
  173. </td>
  174. </tr>
  175. </table>
  176. <input type="hidden" name="serialcount" id="serialcount" value="#count#">
  177.  
  178.  
  179.  
  180. <!--- Adds Delete to every ticket  --->
  181. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  182. <tr>
  183. <td>
  184. <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
  185. </td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
  190. </td>
  191. </tr>
  192. </table>
  193.  
  194.  
  195. <!---Shows what was previously entered into parts table--->
  196. <!---dbtype="query"--->
  197.  
  198.  
  199. <cfquery name="getparts" dbtype="query" >
  200. SELECT *
  201. FROM parts
  202. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  203. cfsqltype="cf_sql_char" maxLength="20">
  204. </cfquery>
  205. <cfset count1 = 0>
  206. <!---<cfif serial.recordcount is 0>--->
  207. <!---<cfloop query="getparts">
  208. <cfset count1 = count1 + 1>--->
  209.  
  210.  
  211.  
  212. <!---The template is where most of the parts section is held--->
  213. <!---<cfinclude template="partsdisplay.cfm">--->
  214.  
  215. <cfset count1 = 0>
  216. <cfloop query="getparts">
  217. <cfset count1 = count1 + 1>
  218. <cfset hc_partNo = #hc_partNo#>
  219. <cfset part_returned = #part_returned#>
  220. <cfset defective = #defective#>
  221. <cfset rma_number = #rma_number#>
  222. <cfinclude template="partsdisplay.cfm">
  223.    </cfloop>
  224.  
  225. <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  226.  <cfset count1 = 1>
  227. <cfset hc_partNo = "">
  228. <cfset part_returned = "">
  229. <cfset defective = ""> 
  230. <cfset rma_number = "">
  231. <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
  232.  </cfif>
  233.  
  234.  
  235.  
  236. <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
  237. <!---</cfloop>
  238. --->
  239.  
  240. </div>
  241. <!---this one makes it so you can add a part to a previously submitted serial--->
  242.  
  243. <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />
  244.  

Thank you,
Rach
Dec 3 '08 #439
acoder
16,027 Expert Mod 8TB
Yes, you're right, it won't work that way.

<cfinclude> won't output variables if the cfoutput is outside. So ignore my previous advice and add cfoutput inside both templates. You can remove it from the edit page unless there's some variables on that page.
Dec 3 '08 #440
bonneylake
769 512MB
Hey Acoder,

So would it be like this for the cticketpage2edit.cfm page?

Expand|Select|Wrap|Line Numbers
  1.     <div id="dynamicInput"> 
  2.      <!--- All Ticket Information Appears Here--->
  3.  
  4. <!---If there is a serial it will show it (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  5. <cfset count = 0>
  6.  <cfloop query="serial"> <cfset count = count + 1>
  7.  <cfset model_no = #model_no#>
  8.  <cfset product_type = #product_type#>
  9.  <cfset type_hardware_failure = #type_hardware_failure#>
  10.   <cfset pka_serialNo = #pka_serialNo#>
  11.  <cfset software_hardware = #software_hardware#>
  12.   <cfset resolution = #resolution#>
  13.  <cfset resolution_date = #resolution_date#>
  14.  <cfset resolution_verified_by = #resolution_verified_by#>
  15.   <cfset verification_date = #verification_date#>
  16.  <cfset dept_responsibility = #dept_responsibility#>
  17.  <cfinclude template="serialpartsdisplay.cfm">
  18.    </cfloop>
  19.  
  20. <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
  21.  <cfif serial.recordcount is 0>
  22.  <cfset count = 1>
  23.  <cfset model_no = "">
  24.  <cfset product_type = "">
  25.  <cfset type_hardware_failure = "">
  26.  <cfset pka_serialNo = "">
  27.  <cfset software_hardware = "">
  28.  <cfset resolution = "">
  29.  <cfset resolution_date = "">
  30.  <cfset resolution_verified_by = "">
  31.  <cfset verification_date = "">
  32.  <cfset dept_responsibility = "">
  33.    <cfinclude template="serialpartsdisplay.cfm">
  34.  </cfif>
  35.  
  36.  
  37.  
  38.  
  39. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  40. </div>
  41.  
  42.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
an then on serialpartsdisplay.cfm would this work

Expand|Select|Wrap|Line Numbers
  1. <cfoutput>
  2. around all serials
  3.  
  4. <cfquery name="getparts" dbtype="query" >
  5. SELECT *
  6. FROM parts
  7. WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
  8. cfsqltype="cf_sql_char" maxLength="20">
  9. </cfquery>
  10. <cfset count1 = 0>
  11. <!---<cfif serial.recordcount is 0>--->
  12. <!---<cfloop query="getparts">
  13. <cfset count1 = count1 + 1>--->
  14.  
  15.  
  16.  
  17. <!---The template is where most of the parts section is held--->
  18. <!---<cfinclude template="partsdisplay.cfm">--->
  19.  
  20. <cfset count1 = 0>
  21. <cfloop query="getparts">
  22. <cfset count1 = count1 + 1>
  23. <cfset hc_partNo = #hc_partNo#>
  24. <cfset part_returned = #part_returned#>
  25. <cfset defective = #defective#>
  26. <cfset rma_number = #rma_number#>
  27. <cfinclude template="partsdisplay.cfm">
  28.    </cfloop>
  29.  
  30. <cfif serial.recordcount is 0 and getparts.recordcount is 0>
  31.  <cfset count1 = 1>
  32. <cfset hc_partNo = "">
  33. <cfset part_returned = "">
  34. <cfset defective = ""> 
  35. <cfset rma_number = "">
  36. <cfinclude template="partsdisplay.cfm">
  37.  </cfif>
  38. </cfoutput>
an then on partsdisplay.cfm all i did was add cfoutput around it all. The parts will work correctly if i filled out a part, except if you have more then one part. If you have more the one part it only displays one part. If you go to add a part to it an submit it, then it deletes the part before it an only show the one you added (for some reason).however, if i don't fill out a part it will not work an i get an error, an thats doing it the way i have explained it. However, i can get the empty part to display (an any part filled in) if i do the following.

Expand|Select|Wrap|Line Numbers
  1. <div id="part#count1#Name#count#">
  2.  
  3. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  4. <cfoutput>
  5. </div>
  6. </cfoutput>
but the problem with doing it this way is then the div is not being counted at all.An i know the hidden input line is whats causing it but no clue what to do
Any ideas?

Thank you,
Rach
Dec 3 '08 #441
acoder
16,027 Expert Mod 8TB
OK, it seems as if you have a problem with the submit page or getting the right format for it. Since it's been a long thread, it's easy to forget what's been added and changed. What's the error message, and what's required for the adding of parts now?
Dec 3 '08 #442
bonneylake
769 512MB
Hey Acoder,

Well it wont tell me exactly what the problem is, it just says contact administrator. When i look at the full error using the bug it says its with pkpartID, which in the line below. But i know it has to be causing the problem because right now if i do not add a serial or part it brings up an error an it has problems with this line and i get an error and parts don't display. However, if i have a serial and part it does not bring up an error but it will not allow me to have 2 or more parts per serial an i believe this line controlled that. pk_partID makes each part have a unique number (in the table)an keep track of it. So i know this line is important, but it does not seem to act right where it is.I know this line was originally wrapped around the cfloop query="getparts" inside the div. but its not a submission problem because its submitting to the database correct. However, its not displaying right an it has to do with pk_partID

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
The only thing i can think of that made the cticketpage2edit.cfm and the serialpartsdisplay.cfm different (the original version we had before making the recent changes ). Was in cticketpage2edit.cfm i had the line pkpartID line, however, in serialpartsdisplay.cfm i didn't have the pkpartID. The pkpartID is only needed if you are displaying previously submitted parts and makes it so each part is unique so recently submitted parts are not deleted an the new ones wont over write the old ones.But i am not sure how to keep the pkpartId to display previously submitted parts an to take it out for parts not added.


Thank you,
Rach
Dec 3 '08 #443
bonneylake
769 512MB
Hey Acoder,

Ok to update from post 443. I have parts displaying now with or without a part added (with no problems). The main problem i am having now is it will only display one part per serial.If i update a ticket an add 2 parts to 1 serial instead of keeping the old one and adding the new one for some reason its deleteing the old one an inserting the new one. I believe the problem is with this

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
  2.  
the reason is because this makes it so each part is unique and its suppose to where if a user adds another part to a previously submitted part its suppose to say this part is here lets insert another instead of overwritting it or deleteing it.

Thank you,
Rach
Dec 3 '08 #444
acoder
16,027 Expert Mod 8TB
Can you post your code for the actual insertion/update on the submit page?

I assume the serial code works absolutely fine?
Dec 3 '08 #445
bonneylake
769 512MB
Hey Acoder,

Yes serials works fine.An i think your right about the parts. I went an retested using the old cticketpage2edit.cfm an it ran into the same problem. But here is what i have on userformedit.cfm

Expand|Select|Wrap|Line Numbers
  1. <CFIF REQUEST_METHOD EQ "POST">
  2.  
  3. <!---counts how many serials are there--->
  4.  <cfquery name="countserials" datasource="CustomerSupport">
  5. SELECT pka_serialNo from dbo.tbl_CS_serial where pkb_fk_ticketNo=<cfqueryparam value="#Form.pk_ticketID#">
  6.  </cfquery>
  7.  <cfset currSerialNo = 1>
  8.  
  9. <!--- the array gets serials that have been inserted and updated to avoid deleteing the ones that need to be inserted or updated--->
  10.  <cfset serialcheck = ArrayNew(1)>
  11. <!--- first loop inserts/update serials--->
  12.  <CFLOOP list="#form.serialcount#" index="machineCount">
  13. <CFSET serialnum       = Form["serialnum_" & machineCount]>
  14. <CFSET modelno         = Form["modelno_" & machineCount]>
  15. <CFSET producttype     = Form["producttype_" & machineCount]>
  16. <CFSET softhardware    = Form["softhardware_" & machineCount]>
  17. <CFSET resolution      = Form["resolution_" & machineCount]>
  18. <CFSET resdate         = Form["resdate_" & machineCount]>
  19. <CFSET resvertified    = Form["resvertified_" & machineCount]>
  20. <CFSET vertifidate     = Form["vertifidate_" & machineCount]>
  21. <CFSET deptvendor      = Form["deptvendor_" & machinecount]>
  22. <CFSET hardwarefailure = Form["hardwarefailure_" & machineCount]>
  23. <CFSET thedescription  = Form["thedescription_" & machineCount]>
  24. <!---the array checks to see what serials are there--->
  25. <CFSET ArrayAppend(serialcheck, "#Form["serialnum_" & machineCount]#")> 
  26.  
  27.  
  28. <!--- counts how many parts are available--->
  29.  <cfquery name="countparts" datasource="CustomerSupport">
  30. SELECT pk_partID from dbo.tbl_CS_parts where fk_serialNo=<cfqueryparam value="#serialnum#"> and fk_ticketNo=<cfqueryparam value="#Form.pk_ticketID#">
  31.  </cfquery>
  32. <!--- the array gets parts that have been inserted and updated to avoid deleteing the ones that need to be inserted or updated--->
  33. <cfset partcheck = ArrayNew(1)>
  34.  
  35.  
  36.  <!--- inserts information into the serial table--->
  37.  <cfquery name="serialinsertupdate" datasource="CustomerSupport">
  38.     exec usp_CS_Updateinsertserial 
  39.      <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  40.      "#Form.pk_ticketID#",
  41.      <cfqueryparam value="#modelno#" CFSQLType = "CF_SQL_VARCHAR">,
  42.       <cfqueryparam value="#producttype#" CFSQLType = "CF_SQL_VARCHAR">,
  43.      <cfqueryparam value="#softhardware#" CFSQLType = "CF_SQL_VARCHAR">,
  44.      <cfqueryparam value="#resolution#" CFSQLType = "CF_SQL_VARCHAR">,
  45.      <cfqueryparam value="#resdate#">,
  46.      <cfqueryparam value="#resvertified#" CFSQLType = "CF_SQL_VARCHAR">,
  47.      <cfqueryparam value="#vertifidate#">,
  48.     <cfqueryparam value="#deptvendor#" CFSQLType = "CF_SQL_VARCHAR">,
  49.      <cfqueryparam value="#hardwarefailure#" CFSQLType = "CF_SQL_VARCHAR">   
  50.      </cfquery>
  51.  
  52.  <!---Inserts information into notes_descr table.--->
  53.  
  54.  <!--- the pk_num makes each description added unique, this allows us to delete one descriptoin instead of all description associated with a serial--->
  55.  <cfif thedescription neq "">
  56. <cfquery name="description" datasource="CustomerSupport">
  57.     exec usp_CS_Insertdescription
  58.    <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  59.    '#Form.pk_ticketID#',
  60.    <cfqueryparam value="#thedescription#" CFSQLType = "CF_SQL_VARCHAR">,
  61.    '#Form.fk_addedBy#'
  62. </cfquery>
  63. <cfelse>
  64.  </cfif>
  65.  
  66.  
  67.   <!---Inserts  information into parts table.--->
  68.   <!---because it is a bit we don't use 'ticks' around defective for parts table--->
  69.  <cfparam name="form.partscount#machinecount#" default="">
  70.  <cfloop list="#form['partscount' & machinecount]#" index="ps">
  71.  <!--- the pkpartID makes each part added unique, this allows us to delete one part instead of all parts associated with a serial--->
  72.   <cfparam name="Form.pkpartID_#ps#_#machinecount#" default="">
  73.  <cfparam name="Form.hcpn_#ps#_#machinecount#" default="">
  74.  <cfparam name="Form.defective_#ps#_#machinecount#" default="0">
  75.  <cfparam name="Form.partsreturn_#ps#_#machinecount#" default="0">
  76.  <cfparam name="Form.rma_#ps#_#machinecount#" default="">
  77. <!--- the pkpartID makes each part added unique, this allows us to delete one part instead of all parts associated with a serial--->
  78.  <CFSET pkpartID           = Form["pkpartID_" & "#ps#" & "_#machinecount#"]>
  79.  <CFSET hcpn            = Form["hcpn_" & "#ps#" & "_#machinecount#"]>
  80.  <CFSET partsreturn     = Form["partsreturn_" & "#ps#" & "_#machinecount#"]>
  81.  <CFSET defective       = Form["defective_" & "#ps#" & "_#machinecount#"]>
  82.  <CFSET rma             = Form["rma_" & "#ps#" & "_#machineCount#"]>
  83. <!---the array checks to see what parts are there--->
  84. <CFSET ArrayAppend(partcheck, "#Form["pkpartID_" & "#ps#" & "_#machinecount#"]#")>
  85. <!---if hcpn is not equal to blank (meaning if it doesn't have a value) it will not insert a part. However if hcpn 
  86. has a value it will insert the part into the table.--->
  87. <cfif hcpn neq "">
  88. <cfquery name="parts" datasource="CustomerSupport">
  89.    exec usp_CS_Updateinsertparts 
  90.    <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  91.    '#Form.pk_ticketID#',
  92.     <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">,
  93.     <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">,
  94.     <cfqueryparam value="#rma#" CFSQLType = "CF_SQL_VARCHAR">,
  95.    <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">
  96.  </cfquery> 
  97.  <cfelse>
  98.  </cfif>
  99. </cfloop>
  100.  
  101. <!---THIS DELETES FOR THE PARTS TABLE--->
  102. <!---setting a list for parts--->
  103. <cfset partList = ArrayToList(partcheck, ",")>
  104. <!---when inserting/updating for part's table is done it then delete parts not being updated/inserted or was to be deleted on purpose--->
  105. <cfloop query="countparts">
  106. <cfset pk_partID= #pk_partID#>
  107. <!---if the part is not found in the list it begins deleteing--->
  108. <cfif not listFind(partList,pk_partID)>
  109. <cfquery name="deleteparts" datasource="CustomerSupport">
  110. exec usp_CS_Deleteparts
  111. <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  112. '#Form.pk_ticketID#'
  113. </cfquery>
  114. </cfif>
  115. </cfloop>
  116.  
  117.  
  118.  
  119. </CFLOOP>
  120.  
  121.  <!---THIS DELETES FOR SERIAL TABLE AND ANY PARTS ASSOCIATED WITH THE SERIAL--->
  122.  <!---setting a list for serial--->
  123.  <cfset serialList = ArrayToList(serialcheck, ",")>
  124.  <!---when inserting/updating for serial's table is done it then delete serials not being updated/inserted or was to be deleted on purpose--->
  125.  <cfloop query="countserials">
  126.  <CFSET serialnum = #pka_serialNo#>
  127.  <!---if the serial is not found in the list it begins deleteing--->
  128.  <cfif not listFind(serialList,serialnum)>
  129.  <cfquery name="deleteserialparts" datasource="CustomerSupport">
  130.  exec usp_CS_Deleteserialparts   
  131.  <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  132.  '#Form.pk_ticketID#'
  133.  </cfquery>
  134. <!--- if a serial is deleted, then the description for that serial will be deleted as well.--->
  135. <cfquery name="deletedescription" datasource="CustomerSupport">
  136. exec usp_CS_Deletenotesdescription
  137. <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  138. '#Form.pk_ticketID#'
  139.  </cfquery>
  140.  </cfif>
  141.  </cfloop>
  142.  
  143. </CFIF>
i am starting to think the problem might not be with are statement but with my stored procedure. If the pk_partId exists it will update, but if it doesn't it inserts. I think because the pk_partID already exists its updating instead of inserting.could this possible be the problem? because i have noticed it is only updating.

Thank you :),
Rach
Dec 3 '08 #446
bonneylake
769 512MB
hey acoder,

I figured it out.It was my stored procedure.basically no matter what the hcpn number was, even if it was different from the first one. For example i inserted 1 and 2 at the same time it would still update to the newest one so i added in my stored procedure

Expand|Select|Wrap|Line Numbers
  1. WHERE  fk_serialNo=@fk_serialNo and fk_ticketNo=@fk_ticketNo and hc_partNo=@hc_partNo

but anyway this made it where if a hc_partNo and pk_part already exists it would update, if not it would insert. The part i am worried about is what if they have 2 hcpn_partNo for the same part? this doesnt seem a problem if for example i have a 2 with serial 1 and 2 with serial 2. It inserted fine with that. But if i try to insert 2 parts both with the same serial its a problem..Any suggestions or is this a problem all just have to deal with? The only solution i can think of is to add another field an count (like did serial) so that then i can do where the serial number, ticket number an whatever the new field i add is it makes it unique even if i add 1 twice in the same serial.

Thank you,
Rach
Dec 3 '08 #447
acoder
16,027 Expert Mod 8TB
Well done on that part (no pun intended ;))! I think the solution should be quite straightforward now. Use the pk_partID (which is unique).
Dec 4 '08 #448
bonneylake
769 512MB
Hey Acoder,

ok i must admit i am confused. Are you saying in my where statement instead of using ticket,serial and the hcpn to use ticket, serial and pk_partid? because i tryed that an it inserted the same part twice perfectly! But i can not get the delete right. Instead of deleteing its adding. But here is what i did

stored procedure for update insert parts

Expand|Select|Wrap|Line Numbers
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6.  
  7. -- =============================================
  8. -- Author:        <Author,,Name>
  9. -- Create date: <Create Date,,>
  10. -- Description:    <Description,,>
  11. -- =============================================
  12. ALTER PROCEDURE [dbo].[usp_CS_Updateinsertparts]
  13. -- Add the parameters for the stored procedure here
  14.            (
  15.     @fk_serialNo nvarchar(100),
  16.     @fk_ticketNo nvarchar(100),
  17.     @hc_partNo nvarchar(50),
  18.     @part_returned char(10),
  19.     @rma_number nvarchar(1000),
  20.     @defective bit
  21.     )
  22. AS
  23. BEGIN
  24.        --- SET should be the first statement .. before everything else
  25.     -- SET NOCOUNT ON added to prevent extra result sets from
  26.     -- interfering with SELECT statements.
  27.     SET NOCOUNT ON;
  28.  
  29.     DECLARE @pk_partID nvarchar(55)
  30.  
  31.  
  32.     -- If @fk_custNum already exists, get the pk_contactID
  33.     SELECT @pk_partID = ( SELECT MAX(pk_partID) FROM dbo.tbl_CS_parts WHERE  fk_serialNo=@fk_serialNo and fk_ticketNo=@fk_ticketNo and pk_partID=@pk_partID)
  34.  
  35.     -- If  @fk_custNum already exists in the table, update it
  36.     IF @pk_partID IS NOT NULL
  37.     BEGIN
  38.  
  39.             UPDATE    dbo.tbl_CS_parts
  40.             SET          
  41.  
  42.                       fk_ticketNo=@fk_ticketNo,
  43.                       hc_partNo=@hc_partNo,
  44.                       part_returned=@part_returned,
  45.                       rma_number=@rma_number,
  46.                       defective=@defective  
  47.  
  48.  
  49.             WHERE  (pk_partID=@pk_partID and fk_serialNo=@fk_serialNo and fk_ticketNo=@fk_ticketNo and pk_partID=@pk_partID )
  50.  
  51.     END
  52.     -- the @fk_custNum does NOT exist. insert a new record
  53.     ELSE
  54.     BEGIN
  55.  
  56.             -- insert a new record
  57.             SET @pk_partID = (SELECT max_num FROM tbl_CS_ID_HELPER WHERE table_name='tbl_CS_parts')
  58.             UPDATE tbl_CS_ID_helper SET  max_num=max_num+1 WHERE table_name='tbl_CS_parts'
  59.  
  60.         -- Insert statements for procedure here
  61.         INSERT INTO tbl_CS_parts
  62.         (
  63.             pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned ,defective ,rma_number
  64.         )
  65.         VALUES
  66.         (
  67.             @pk_partID,@fk_serialNo,@fk_ticketNo,@hc_partNo,@part_returned,@defective ,@rma_number
  68.         )
  69.     END
  70.  
  71.     --- return the @pk_contactID
  72.     SELECT @pk_partID AS partID
  73.  
  74.     SET NOCOUNT OFF
  75. END
  76.  
  77.  
delete for parts

Expand|Select|Wrap|Line Numbers
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6.  
  7.  
  8. -- =============================================
  9. -- Author:        <Author,,Name>
  10. -- Create date: <Create Date,,>
  11. -- Description:    <Description,,>
  12. -- =============================================
  13. ALTER PROCEDURE [dbo].[usp_CS_Deleteparts]
  14. -- Add the parameters for the stored procedure here
  15.     (@pk_partID nvarchar(55),
  16. @fk_serialNo nvarchar(100),
  17.      @fk_ticketNo nvarchar(100)) 
  18. AS
  19.  
  20. DELETE FROM tbl_CS_parts
  21.  
  22.  
  23. WHERE (pk_partID = @pk_partID and fk_serialNo = @fk_serialNo and  fk_ticketNo=@fk_ticketNo)
  24.  
an then on the userformedit.cfm i did the following to the parts section
Expand|Select|Wrap|Line Numbers
  1. <!--- counts how many parts are available--->
  2.  <cfquery name="countparts" datasource="CustomerSupport">
  3. SELECT pk_partID from dbo.tbl_CS_parts where fk_serialNo=<cfqueryparam value="#serialnum#"> and fk_ticketNo=<cfqueryparam value="#Form.pk_ticketID#">
  4.  </cfquery>
  5. <!--- the array gets parts that have been inserted and updated to avoid deleteing the ones that need to be inserted or updated--->
  6. <cfset partcheck = ArrayNew(1)>
  7.  
  8.  
  9. the above appears under the serial cfsets an the below is the main parts section
  10.  
  11.   <!---Inserts  information into parts table.--->
  12.   <!---because it is a bit we don't use 'ticks' around defective for parts table--->
  13.  <cfparam name="form.partscount#machinecount#" default="">
  14.  <cfloop list="#form['partscount' & machinecount]#" index="ps">
  15.  <!--- the pkpartID makes each part added unique, this allows us to delete one part instead of all parts associated with a serial--->
  16.   <cfparam name="Form.pkpartID_#ps#_#machinecount#" default="">
  17.  
  18.  <cfparam name="Form.hcpn_#ps#_#machinecount#" default="">
  19.  <cfparam name="Form.defective_#ps#_#machinecount#" default="0">
  20.  <cfparam name="Form.partsreturn_#ps#_#machinecount#" default="0">
  21.  <cfparam name="Form.rma_#ps#_#machinecount#" default="">
  22. <!--- the pkpartID makes each part added unique, this allows us to delete one part instead of all parts associated with a serial--->
  23.  
  24.  <CFSET pkpartID           = Form["pkpartID_" & "#ps#" & "_#machinecount#"]>
  25.  <CFSET hcpn            = Form["hcpn_" & "#ps#" & "_#machinecount#"]>
  26.  <CFSET partsreturn     = Form["partsreturn_" & "#ps#" & "_#machinecount#"]>
  27.  <CFSET defective       = Form["defective_" & "#ps#" & "_#machinecount#"]>
  28.  <CFSET rma             = Form["rma_" & "#ps#" & "_#machineCount#"]>
  29. <!---the array checks to see what parts are there--->
  30. <CFSET ArrayAppend(partcheck, "#Form["pkpartID_" & "#ps#" & "_#machinecount#"]#")>
  31. <!---if hcpn is not equal to blank (meaning if it doesn't have a value) it will not insert a part. However if hcpn 
  32. has a value it will insert the part into the table.--->
  33. <cfif hcpn neq "">
  34. <cfquery name="parts" datasource="CustomerSupport">
  35.    exec usp_CS_Updateinsertparts 
  36.    <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  37.    '#Form.pk_ticketID#',
  38.     <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">,
  39.     <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">,
  40.     <cfqueryparam value="#rma#" CFSQLType = "CF_SQL_VARCHAR">,
  41.    <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">
  42.  </cfquery> 
  43.  <cfelse>
  44.  </cfif>
  45. </cfloop>
  46.  
  47. <!---THIS DELETES FOR THE PARTS TABLE--->
  48. <!---setting a list for parts--->
  49. <cfset partList = ArrayToList(partcheck, ",")>
  50. <!---when inserting/updating for part's table is done it then delete parts not being updated/inserted or was to be deleted on purpose--->
  51. <cfloop query="countparts">
  52. <cfset pk_partID= #pk_partID#>
  53. <!---if the part is not found in the list it begins deleteing--->
  54. <cfif not listFind(partList,pk_partID)>
  55. <cfquery name="deleteparts" datasource="CustomerSupport">
  56. exec usp_CS_Deleteparts
  57. <cfqueryparam value="#pkpartID#" CFSQLType = "CF_SQL_VARCHAR">,
  58. <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
  59. '#Form.pk_ticketID#'
  60.  
  61. </cfquery>
  62. </cfif>
  63. </cfloop>
  64.  
  65.  




Thank you,
Rach
Dec 4 '08 #449
acoder
16,027 Expert Mod 8TB
In your update/insert stored procedure, you have hcpn missing, and in your Coldfusion code, you've missed out the part ID, so the wrong data is being passed for the fields.
Dec 4 '08 #450

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Vigneshwar Pilli via DotNetMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.