473,804 Members | 3,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to loop through this?

769 Contributor
Hey Everyone,

What i am trying to do is show previously entered information. I know i need a loop for this , but i am not sure how to loop through this based on my form appears all in the javascript

here is my code
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="serial" datasource="CustomerSupport">
  2.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
  3.          verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
  4. </cfquery>
  5.  
  6. <cfoutput query="serial">
  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. </cfoutput>
  14.  
  15. <script type="text/javascript">
  16.  
  17. <!---Allows us to show previous fields --->
  18.  
  19. function showInput(divName){
  20. var dynamic = document.getElementById('dynamicInput');
  21. var thevalue = document.getElementById('theValue');
  22. var count = (document.getElementById('theValue').value -1)+ 2;
  23. thevalue.value = count;
  24. var newdiv = document.createElement('div');
  25. var divIdName = 'dynamic'+count+'Input';
  26. newdiv.setAttribute('id',divIdName);
  27.  
  28.  
  29. <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  30. newdiv.innerHTML =
  31.  
  32. "<table class='zpExpandedTable' id='modeltable'>" +
  33. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  34. "<tr>" +
  35. "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
  36. "</td>" +
  37. "<td>" +
  38.  "<select name='modelno_" + count + "'>" +
  39.  "<option value=''>Make A Selection</option>" +
  40. "<cfoutput query='models'>" + 
  41. "<option value='#model#'<cfif #model# is #evaluate(model_no)#>selected</cfif>>#model#</option>" + 
  42. "</cfoutput>" + 
  43.  "</select>" +
  44.  "</td>" +
  45.  "<td>" +
  46. "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
  47. "</td>" +
  48. "<td>" +
  49. "<select name='producttype_" + count + "'>" +
  50. "<option value='' selected>No Choice</option>" +
  51. "<cfoutput query='getProdType'>" + 
  52. "<option value='#pk_productType#'<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option>" + 
  53. "</cfoutput>" + 
  54. "</select>" +
  55. "</td>" +
  56. "<td class='red'>" +
  57. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
  58. "</td>" +
  59. "<td>" +
  60. "<select name='hardwarefailure_" + count + "'>" +
  61. "<option value='' selected>Make A Selection</option>" +
  62. "<cfoutput query='getHardwareFail'>" +
  63. "<option value='#pk_hardwareFailure#'<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>" +
  64. "</cfoutput>" +
  65. "</select>" +
  66. "</td>" +
  67. "</tr>" +
  68. "<table>";
  69.  
  70. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  71. newdiv.innerHTML = newdiv.innerHTML +
  72. "<table class='zpExpandedTable' id='modeltable'>" +
  73. "<tr>" +
  74. "<td id='paddingformultitop'>" +
  75. "Serial Number:&nbsp;&nbsp;" +
  76. "<cfoutput query="serial"><input type='text' name='serialnum_" + count + "' value='#pka_serialNo#' ></cfoutput>" +
  77. "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
  78. "<select name='softhardware_" + count + "'>" +
  79. "<option value='' selected>No Choice</option>" +
  80. "<cfoutput query='getSoftHard'>" + 
  81. "<option value='#pk_softwareHardware#'<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>" + 
  82. "</cfoutput>" + 
  83. "</select>" +
  84. "</td>" +
  85. "</tr>" +
  86. "</table>";
  87.  
  88. <!--- Adds Extra fields for Description ---> 
  89. newdiv.innerHTML = newdiv.innerHTML + 
  90. "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
  91. "<tr>" +
  92. "<td id='paddingformutli'>" +
  93. "Description:&nbsp;&nbsp;" + 
  94. "</td>" +
  95. "<td class='descriptionmoveinmulti'>" +
  96. "( You may enter up to 500 characters. )"+
  97. "<br>" +
  98. "<cfoutput query="description"><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'>#description#</textarea></cfoutput>" + 
  99. "</td>" +
  100. "</tr>" +
  101. "</table>";
  102.  
  103. <!--- Adds Extra fields for Resolution  --->
  104. newdiv.innerHTML = newdiv.innerHTML +
  105. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  106. "<tr>" +
  107. "<td id='paddingformutli'>" +
  108. "Resolution:&nbsp;&nbsp;" +
  109. "</td>" +
  110. "<td class='resolutionmoveinmulti'>" +
  111. "( You may enter up to 500 characters. )"+
  112. "<br>" +
  113. "<cfoutput query='serial'><textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'>#resolution#</textarea></cfoutput>" +
  114. "</td>" +
  115. "</tr>" +
  116. "</table>";
  117.  
  118. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  119. newdiv.innerHTML = newdiv.innerHTML +
  120. "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
  121. "<tr>" +
  122. "<td id='paddingformultitop'>" +
  123. "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  124. "</td>" +
  125. "<td>" +
  126. "<cfoutput query='serial'><input type='text' name='resdate_" + count + "' value='#resolution_date#'>&nbsp;&nbsp;</cfoutput>" +
  127.  
  128. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  129. "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
  130. "</td>" +
  131. "<td>" +
  132. "Resolution Verified as effective by:&nbsp;&nbsp;"  +
  133. "</td>" +
  134. "<td>" +
  135. "<select name='resvertified_" + count + "'>" +
  136. "<option value='' selected>Make A Selection</option>" +
  137. "<cfoutput query='gettech'>" +
  138. "<option value='#fname# #lname#'<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>" +
  139. " </cfoutput>" +
  140. "</select>" +
  141. "</td>" +
  142. "</tr>" +
  143. "</table>";
  144.  
  145.  
  146. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
  147. newdiv.innerHTML = newdiv.innerHTML +
  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. "<cfoutput query='serial'><input type='text' name='vertifidate_" + count + "' value='#verification_date#'>&nbsp;&nbsp;</cfoutput>" +
  155. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  156. "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
  157. "</td>" +
  158. "</tr>" +
  159. "</table>";
  160.  
  161. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  162. newdiv.innerHTML = newdiv.innerHTML +
  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. "<cfoutput query='getDeptVendor'>" +
  170. "<option value='#pk_deptVendor#'<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>" +
  171. " </cfoutput>" +
  172. "</select>" +
  173. "</td>" +
  174. "</tr>" +
  175. "</table>";
  176.  
  177. <!--- Adds Extra fields for RMA Data Only  --->
  178. newdiv.innerHTML = newdiv.innerHTML +
  179. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  180. "<tr>" +
  181. "<td id='paddingformultitop'>" +
  182. "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
  183. "</td>" +
  184. "<td class='rmanmoveinmulti'>" +
  185. "( You may enter up to 500 characters. )"+
  186. "<br/>" +
  187. "<cfoutput query='serial'><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "' >#rma_data#</textarea></cfoutput> " +
  188. "</td>" +
  189. "</tr>" +
  190. "</table>" +
  191. "<input type='hidden' name='serialcount' value='" + count + "'>";
  192.  
  193. <!--- Adds Delete to every ticket  --->
  194. newdiv.innerHTML = newdiv.innerHTML +
  195. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  196. "<tr>" +
  197. "<td>" +
  198. "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
  199. "</td>" +
  200. "</td>" +
  201. "</tr>" +
  202. "</table><br>";
  203.  
  204.  document.getElementById(divName).appendChild(newdiv);
  205.  
  206. </script>

i was using this after i submitted my form to loop through it. it was used to submit the form fields and also show a print screen on what was previously entered.

Expand|Select|Wrap|Line Numbers
  1. <CFSET machineListLen = listLen(Form.serialcount)>
  2. <CFLOOP from="1" to="#machineListLen#" index="machineCount">
  3.  <CFSET serialnum       = "Form.serialnum_" & machineCount>
  4.  <CFSET modelno         = "Form.modelno_" & machineCount>
  5.  <CFSET producttype     = "Form.producttype_" & machineCount>
  6.  <CFSET softhardware    = "Form.softhardware_" & machineCount>
  7.  <CFSET resolution      = "Form.resolution_" & machineCount>
  8.  <CFSET resdate         = "Form.resdate_" & machineCount>
  9.  <CFSET resvertified    = "Form.resvertified_" & machineCount>
  10.  <CFSET vertifidate     = "Form.vertifidate_" & machineCount>
  11.  <CFSET deptvendor      = "Form.deptvendor_" & machinecount>
  12.  <CFSET hardwarefailure = "Form.hardwarefailure_" & machineCount>
  13.  <CFSET rma             = "Form.rma_" & machineCount>
  14.  <CFSET thedescription  = "Form.thedescription_" & machineCount>
  15.  
  16. #evaluate(modelno)#....an so on.
but i am not sure if i can combine the above with what i have now because i am showing previously entered data an not entering the data.

Thank you for all the help,
Rach
Sep 22 '08 #1
60 5283
acoder
16,027 Recognized Expert Moderator MVP
Rather than using JavaScript to show the information onload, use Coldfusion directly in the HTML inside the "dynamicInp ut" div using a loop (cfoutput or cfloop) to loop over the query. Convert the JavaScript innerHTML statements into normal HTML code.
Sep 22 '08 #2
bonneylake
769 Contributor
Rather than using JavaScript to show the information onload, use Coldfusion directly in the HTML inside the "dynamicInp ut" div using a loop (cfoutput or cfloop) to loop over the query. Convert the JavaScript innerHTML statements into normal HTML code.
Hey Acoder,

Ok so let me make sure i understand you correctly.So take all the form information inside the javascript copy it and turn it into just HTML an put it in my <div id="dynamicInpu t"> an then apply the cfloop to it. Then in the javscript part turn it in just HTML? Just want to make sure i understand before i go ahead.

Thank you,
Rach
Sep 22 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Almost. There's no need for any JavaScript here because you're calling it onload anyway. Convert all the JavaScript into Coldfusion instead so that the table/form appears whilst the page is loading and not after. To convert the JavaScript is not difficult. Take all the table and form code and put it directly in the div. The cfloop would be for each ticket, so there would be no repetition.
Sep 22 '08 #4
bonneylake
769 Contributor
Almost. There's no need for any JavaScript here because you're calling it onload anyway. Convert all the JavaScript into Coldfusion instead so that the table/form appears whilst the page is loading and not after. To convert the JavaScript is not difficult. Take all the table and form code and put it directly in the div. The cfloop would be for each ticket, so there would be no repetition.
Hey Acoder,

I hate to say this but i am still very confused. This is what i have below. Do i need to remove the function showInput since i was using that one to show what was previously entered? an do i apply the cfloop i was using above or do i create a different one? a bit confused.


Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. <!---Allows us to show previous fields --->
  4.  
  5. function showInput(divName){
  6. var dynamic = document.getElementById('dynamicInput');
  7. var thevalue = document.getElementById('theValue');
  8. var count = (document.getElementById('theValue').value -1)+ 2;
  9. thevalue.value = count;
  10. var newdiv = document.createElement('div');
  11. var divIdName = 'dynamic'+count+'Input';
  12. newdiv.setAttribute('id',divIdName);
  13.  
  14.  
  15. <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  16. newdiv.innerHTML =
  17.  
  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#'<cfif #model# is #model_no#>selected</cfif>>#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#'<cfif #pk_productType# is #product_type#>selected</cfif>>#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#'<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#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. "<cfoutput query="serial"><input type='text' name='serialnum_" + count + "' value='#pka_serialNo#' ></cfoutput>" +
  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#'<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#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 500 characters. )"+
  83. "<br>" +
  84. "<cfoutput query="description"><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'>#description#</textarea></cfoutput>" + 
  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 500 characters. )"+
  98. "<br>" +
  99. "<cfoutput query='serial'><textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'>#resolution#</textarea></cfoutput>" +
  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. "<cfoutput query='serial'><input type='text' name='resdate_" + count + "' value='#resolution_date#'>&nbsp;&nbsp;</cfoutput>" +
  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'>" +
  124. "<option value='#fname# #lname#'<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>" +
  125. " </cfoutput>" +
  126. "</select>" +
  127. "</td>" +
  128. "</tr>" +
  129. "</table>";
  130.  
  131.  
  132. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
  133. newdiv.innerHTML = newdiv.innerHTML +
  134. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  135. "<tr>" +
  136. "<td id='paddingformultitop'>" +
  137. "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  138. "</td>" +
  139. "<td class='vertificationmoveinmulti'>" +
  140. "<cfoutput query='serial'><input type='text' name='vertifidate_" + count + "' value='#verification_date#'>&nbsp;&nbsp;</cfoutput>" +
  141. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  142. "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
  143. "</td>" +
  144. "</tr>" +
  145. "</table>";
  146.  
  147. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  148. newdiv.innerHTML = newdiv.innerHTML +
  149. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  150. "<tr>" +
  151. "<td class='red' id='paddingformultitop'>" +
  152. "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
  153. "<select name='deptvendor_" + count + "'>" +
  154. "<option value='' selected>Make A Selection</option>" +
  155. "<cfoutput query='getDeptVendor'>" +
  156. "<option value='#pk_deptVendor#'<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>" +
  157. " </cfoutput>" +
  158. "</select>" +
  159. "</td>" +
  160. "</tr>" +
  161. "</table>";
  162.  
  163. <!--- Adds Extra fields for RMA Data Only  --->
  164. newdiv.innerHTML = newdiv.innerHTML +
  165. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  166. "<tr>" +
  167. "<td id='paddingformultitop'>" +
  168. "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
  169. "</td>" +
  170. "<td class='rmanmoveinmulti'>" +
  171. "( You may enter up to 500 characters. )"+
  172. "<br/>" +
  173. "<cfoutput query='serial'><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "' >#rma_data#</textarea></cfoutput> " +
  174. "</td>" +
  175. "</tr>" +
  176. "</table>" +
  177. "<input type='hidden' name='serialcount' value='" + count + "'>";
  178.  
  179. <!--- Adds Delete to every ticket  --->
  180. newdiv.innerHTML = newdiv.innerHTML +
  181. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  182. "<tr>" +
  183. "<td>" +
  184. "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
  185. "</td>" +
  186. "</td>" +
  187. "</tr>" +
  188. "</table><br>";
  189.  
  190.  document.getElementById(divName).appendChild(newdiv);
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  <!---Allows us to add serial information multiple times --->
  198. function addInput(divName){
  199. var dynamic = document.getElementById('dynamicInput');
  200. var thevalue = document.getElementById('theValue');
  201. var count = (document.getElementById('theValue').value -1)+ 2;
  202. thevalue.value = count;
  203. var newdiv = document.createElement('div');
  204. var divIdName = 'dynamic'+count+'Input';
  205. newdiv.setAttribute('id',divIdName);
  206.  
  207. <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  208. newdiv.innerHTML =
  209. "<table class='zpExpandedTable' id='modeltable'>" +
  210. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  211. "<tr>" +
  212. "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
  213. "</td>" +
  214. "<td>" +
  215.  "<select name='modelno_" + count + "' >" +
  216.  "<option value=''>Make A Selection</option>" +
  217. "<cfoutput query='models'>" + 
  218. "<option value='#model#'>#model#</option>" + 
  219. "</cfoutput>" + 
  220.  "</select>" +
  221.  "</td>" +
  222.  "<td>" +
  223. "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
  224. "</td>" +
  225. "<td>" +
  226. "<select name='producttype_" + count + "'>" +
  227. "<option value='' selected>No Choice</option>" +
  228. "<cfoutput query='getProdType'>" + 
  229. "<option value='#pk_productType#'>#pk_productType#</option>" + 
  230. "</cfoutput>" + 
  231. "</select>" +
  232. "</td>" +
  233. "<td class='red'>" +
  234. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
  235. "</td>" +
  236. "<td>" +
  237. "<select name='hardwarefailure_" + count + "'>" +
  238. "<option value='' selected>Make A Selection</option>" +
  239. "<cfoutput query='getHardwareFail'>" +
  240. "<option value='#pk_hardwareFailure#'>#pk_hardwareFailure#</option>" +
  241. "</cfoutput>" +
  242. "</select>" +
  243. "</td>" +
  244. "</tr>" +
  245. "<table>";
  246.  
  247. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  248. newdiv.innerHTML = newdiv.innerHTML +
  249. "<table class='zpExpandedTable' id='modeltable'>" +
  250. "<tr>" +
  251. "<td id='paddingformultitop'>" +
  252. "Serial Number:&nbsp;&nbsp;" +
  253. "<input type='text' name='serialnum_" + count + "'>" +
  254. "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
  255. "<select name='softhardware_" + count + "'>" +
  256. "<option value='' selected>No Choice</option>" +
  257. "<cfoutput query='getSoftHard'>" + 
  258. "<option value='#pk_softwareHardware#'>#pk_softwareHardware#</option>" + 
  259. "</cfoutput>" + 
  260. "</select>" +
  261. "</td>" +
  262. "</tr>" +
  263. "</table>";
  264.  
  265. <!--- Adds Extra fields for Description  --->
  266. newdiv.innerHTML = newdiv.innerHTML + 
  267. "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
  268. "<tr>" +
  269. "<td id='paddingformutli'>" +
  270. "Description:&nbsp;&nbsp;" + 
  271. "</td>" +
  272. "<td class='descriptionmoveinmulti'>" +
  273. "( You may enter up to 500 characters. )"+
  274. "<br>" +
  275. "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'></textarea>" + 
  276. "</td>" +
  277. "</tr>" +
  278. "</table>";
  279.  
  280. <!--- Adds Extra fields for Resolution  --->
  281. newdiv.innerHTML = newdiv.innerHTML +
  282. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  283. "<tr>" +
  284. "<td id='paddingformutli'>" +
  285. "Resolution:&nbsp;&nbsp;" +
  286. "</td>" +
  287. "<td class='resolutionmoveinmulti'>" +
  288. "( You may enter up to 500 characters. )"+
  289. "<br>" +
  290. "<textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'></textarea>" +
  291. "</td>" +
  292. "</tr>" +
  293. "</table>";
  294.  
  295. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  296. newdiv.innerHTML = newdiv.innerHTML +
  297. "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
  298. "<tr>" +
  299. "<td id='paddingformultitop'>" +
  300. "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  301. "</td>" +
  302. "<td>" +
  303. "<input type='text' name='resdate_" + count + "' value=''  >&nbsp;&nbsp;" +
  304.  
  305. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  306. "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
  307. "</td>" +
  308. "<td>" +
  309.  
  310. "Resolution Verified as effective by:&nbsp;&nbsp;"  +
  311. "</td>" +
  312. "<td>" +
  313. "<select name='resvertified_" + count + "'>" +
  314. "<option value='' selected>Make A Selection</option>" +
  315. "<cfoutput query='gettech'><option value='#fname# #lname#'>#fname# #lname#</option></cfoutput></select>" +
  316. "</td>" +
  317. "</tr>" +
  318. "</table>";
  319.  
  320. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) and resolution vertified as effective by  --->
  321. newdiv.innerHTML = newdiv.innerHTML +
  322. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  323. "<tr>" +
  324. "<td id='paddingformultitop'>" +
  325. "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  326. "</td>" +
  327. "<td class='vertificationmoveinmulti'>" +
  328. "<input type='text' name='vertifidate_" + count + "'>&nbsp;&nbsp;" +
  329. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  330. "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
  331. "</td>" +
  332. "</tr>" +
  333. "</table>";
  334.  
  335. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  336. newdiv.innerHTML = newdiv.innerHTML +
  337. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  338. "<tr>" +
  339. "<td class='red' id='paddingformultitop'>" +
  340. "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
  341. "<select name='deptvendor_" + count + "'>" +
  342. "<option value='' selected>Make A Selection</option>" +
  343. "<cfoutput query='getDeptVendor'>" +
  344. "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
  345. " </cfoutput>" +
  346. "</select>" +
  347. "</td>" +
  348. "</tr>" +
  349. "</table>";
  350.  
  351. <!--- Adds Extra fields for RMA Data Only  --->
  352. newdiv.innerHTML = newdiv.innerHTML +
  353. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  354. "<tr>" +
  355. "<td id='paddingformultitop'>" +
  356. "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
  357. "</td>" +
  358. "<td class='rmanmoveinmulti'>" +
  359. "( You may enter up to 500 characters. )"+
  360. "<br/>" +
  361. "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "'></textarea> " +
  362. "</td>" +
  363. "</tr>" +
  364. "</table>" +
  365. "<input type='hidden' name='serialcount' value='" + count + "'>";
  366.  
  367. <!--- Adds Delete to every ticket  --->
  368. newdiv.innerHTML = newdiv.innerHTML +
  369. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  370. "<tr>" +
  371. "<td>" +
  372. "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
  373. "</td>" +
  374. "</td>" +
  375. "</tr>" +
  376. "</table>";
  377.  
  378. document.getElementById(divName).appendChild(newdiv);
  379.  
  380.  
  381. <!---Allows us to remove multiple fields --->
  382. function removeElement(divNum) {
  383.   var d = document.getElementById('dynamicInput');
  384.   var olddiv = document.getElementById(divNum);
  385.   d.removeChild(olddiv);
  386. }
  387.  
  388. </script>
  389. <body onload="showInput('dynamicInput');">
  390. <!--- Ticket Information 
  391.        This display the ticket Information--->
  392.  
  393.  
  394.  
  395.  
  396. <input type="hidden" value="0" id="theValue" />
  397.      <div id="dynamicInput">
  398.      <!--- All Ticket Information Appears Here--->
  399.     <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  400.  
  401.  
  402. <table class="zpExpandedTable" id="modeltable">
  403. <th class="sectiontitletick" colspan="7">Serial Information '+ count +' </th>
  404. <tr>
  405. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  406. </td>
  407. <td>
  408. <select name="modelno_' + count + '">
  409. <option value="">Make A Selection</option>
  410. <cfoutput query="models">
  411. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  412. </cfoutput> 
  413. </select>
  414. </td>
  415. <td>
  416. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  417. </td>
  418. <td>
  419. <select name="producttype_' + count + '">
  420. <option value="" selected>No Choice</option>
  421. <cfoutput query="getProdType">
  422. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  423. </cfoutput>
  424. </select>
  425. </td>
  426. <td class="red'">
  427. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  428. </td>
  429. <td>
  430. <select name="hardwarefailure_' + count + '">
  431. <option value="" selected>Make A Selection</option>
  432. <cfoutput query="getHardwareFail">
  433. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  434. </cfoutput>
  435. </select>
  436. </td>
  437. </tr>
  438. <table>
  439.  
  440. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  441. <table class="zpExpandedTable" id="modeltable">
  442. <tr>
  443. <td id="paddingformultitop">
  444. Serial Number:&nbsp;&nbsp;
  445. <cfoutput query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfoutput>
  446. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  447. <select name="softhardware_' + count + '">
  448. <option value="" selected>No Choice</option>
  449. <cfoutput query="getSoftHard">
  450. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  451. </cfoutput>
  452. </select>
  453. </td>
  454. </tr>
  455. </table>
  456.  
  457. <!--- Adds Extra fields for Description ---> 
  458.  
  459. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  460. <tr>
  461. <td id="paddingformutli">
  462. Description:&nbsp;&nbsp;
  463. </td>
  464. <td class="descriptionmoveinmulti">
  465. ( You may enter up to 500 characters. )
  466. <br>
  467. <cfoutput query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfoutput> 
  468. </td>
  469. </tr>
  470. </table>
  471.  
  472. <!--- Adds Extra fields for Resolution  --->
  473.  
  474. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  475. <tr>
  476. <td id="paddingformutli">
  477. Resolution:&nbsp;&nbsp;
  478. </td>
  479. <td class="resolutionmoveinmulti">
  480. ( You may enter up to 500 characters. )
  481. <br>
  482. <cfoutput query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfoutput>
  483. </td>
  484. </tr>
  485. </table>
  486.  
  487. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  488.  
  489. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  490. <tr>
  491. <td id="paddingformultitop">
  492. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  493. </td>
  494. <td>
  495. <cfoutput query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfoutput>
  496.  
  497. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  498. <input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>
  499. </td>
  500. <td>
  501. Resolution Verified as effective by:&nbsp;&nbsp;
  502. </td>
  503. <td>
  504. <select name="resvertified_' + count + '">
  505. <option value="" selected>Make A Selection</option>
  506. <cfoutput query="gettech">
  507. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  508. </cfoutput>
  509. </select>
  510. </td>
  511. </tr>
  512. </table>
  513.  
  514.  
  515. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
  516. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  517. <tr>
  518. <td id="paddingformultitop">
  519. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  520. </td>
  521. <td class="vertificationmoveinmulti">
  522. <cfoutput query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfoutput>
  523. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  524. <input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>
  525. </td>
  526. </tr>
  527. </table>
  528.  
  529. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  530. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  531. <tr>
  532. <td class="red" id="paddingformultitop">
  533. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  534. <select name="deptvendor_' + count + '">
  535. <option value="" selected>Make A Selection</option>
  536. <cfoutput query="getDeptVendor">
  537. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  538. </cfoutput>
  539. </select>
  540. </td>
  541. </tr>
  542. </table>
  543.  
  544. <!--- Adds Extra fields for RMA Data Only  --->
  545. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  546. <tr>
  547. <td id="paddingformultitop">
  548. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  549. </td>
  550. <td class="rmanmoveinmulti">
  551. ( You may enter up to 500 characters. )
  552. <br/>
  553. <cfoutput query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfoutput>
  554. </td>
  555. </tr>
  556. </table>
  557. <input type="hidden" name="serialcount" value="' + count + '">
  558.  
  559. <!--- Adds Delete to every ticket  --->
  560. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  561. <tr>
  562. <td>
  563. <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
  564. </td>
  565. </td>
  566. </tr>
  567. </table>
  568.  
  569.  
  570.  
  571.  
  572.  
  573.      </div>
  574.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
Thank you,
Rach
Sep 23 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
Yes, there's no need for the showInput function any more. For example, you can replace:
Expand|Select|Wrap|Line Numbers
  1. newdiv.innerHTML =
  2. "<table class='zpExpandedTable' id='modeltable'>" +
  3. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  4. "<tr>" +
with
Expand|Select|Wrap|Line Numbers
  1. <div ...>
  2. <cfoutput query="...">
  3. <table class='zpExpandedTable' id='modeltable'>
  4. <th class='sectiontitletick' colspan='7'>Serial Information #count# </th>
  5. <tr>
Sep 23 '08 #6
bonneylake
769 Contributor
Yes, there's no need for the showInput function any more. For example, you can replace:
Expand|Select|Wrap|Line Numbers
  1. newdiv.innerHTML =
  2. "<table class='zpExpandedTable' id='modeltable'>" +
  3. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  4. "<tr>" +
with
Expand|Select|Wrap|Line Numbers
  1. <div ...>
  2. <cfoutput query="...">
  3. <table class='zpExpandedTable' id='modeltable'>
  4. <th class='sectiontitletick' colspan='7'>Serial Information #count# </th>
  5. <tr>
Hey Acoder,

Well i am having trouble doing the #count# part you did in your example i just get an error. An i am having trouble with my current date stuff. Basically from that point on it wont show any of the other parts in the table unless i take it out. Bolded the parts having trouble with

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.  <!---Allows us to add serial information multiple times --->
  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 divIdName = 'dynamic'+count+'Input';
  11. newdiv.setAttribute('id',divIdName);
  12.  
  13. <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  14. newdiv.innerHTML =
  15. "<table class='zpExpandedTable' id='modeltable'>" +
  16. "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
  17. "<tr>" +
  18. "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
  19. "</td>" +
  20. "<td>" +
  21.  "<select name='modelno_" + count + "' >" +
  22.  "<option value=''>Make A Selection</option>" +
  23. "<cfoutput query='models'>" + 
  24. "<option value='#model#'>#model#</option>" + 
  25. "</cfoutput>" + 
  26.  "</select>" +
  27.  "</td>" +
  28.  "<td>" +
  29. "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
  30. "</td>" +
  31. "<td>" +
  32. "<select name='producttype_" + count + "'>" +
  33. "<option value='' selected>No Choice</option>" +
  34. "<cfoutput query='getProdType'>" + 
  35. "<option value='#pk_productType#'>#pk_productType#</option>" + 
  36. "</cfoutput>" + 
  37. "</select>" +
  38. "</td>" +
  39. "<td class='red'>" +
  40. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
  41. "</td>" +
  42. "<td>" +
  43. "<select name='hardwarefailure_" + count + "'>" +
  44. "<option value='' selected>Make A Selection</option>" +
  45. "<cfoutput query='getHardwareFail'>" +
  46. "<option value='#pk_hardwareFailure#'>#pk_hardwareFailure#</option>" +
  47. "</cfoutput>" +
  48. "</select>" +
  49. "</td>" +
  50. "</tr>" +
  51. "<table>";
  52.  
  53. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  54. newdiv.innerHTML = newdiv.innerHTML +
  55. "<table class='zpExpandedTable' id='modeltable'>" +
  56. "<tr>" +
  57. "<td id='paddingformultitop'>" +
  58. "Serial Number:&nbsp;&nbsp;" +
  59. "<input type='text' name='serialnum_" + count + "'>" +
  60. "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
  61. "<select name='softhardware_" + count + "'>" +
  62. "<option value='' selected>No Choice</option>" +
  63. "<cfoutput query='getSoftHard'>" + 
  64. "<option value='#pk_softwareHardware#'>#pk_softwareHardware#</option>" + 
  65. "</cfoutput>" + 
  66. "</select>" +
  67. "</td>" +
  68. "</tr>" +
  69. "</table>";
  70.  
  71. <!--- Adds Extra fields for Description  --->
  72. newdiv.innerHTML = newdiv.innerHTML + 
  73. "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
  74. "<tr>" +
  75. "<td id='paddingformutli'>" +
  76. "Description:&nbsp;&nbsp;" + 
  77. "</td>" +
  78. "<td class='descriptionmoveinmulti'>" +
  79. "( You may enter up to 500 characters. )"+
  80. "<br>" +
  81. "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'></textarea>" + 
  82. "</td>" +
  83. "</tr>" +
  84. "</table>";
  85.  
  86. <!--- Adds Extra fields for Resolution  --->
  87. newdiv.innerHTML = newdiv.innerHTML +
  88. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  89. "<tr>" +
  90. "<td id='paddingformutli'>" +
  91. "Resolution:&nbsp;&nbsp;" +
  92. "</td>" +
  93. "<td class='resolutionmoveinmulti'>" +
  94. "( You may enter up to 500 characters. )"+
  95. "<br>" +
  96. "<textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'></textarea>" +
  97. "</td>" +
  98. "</tr>" +
  99. "</table>";
  100.  
  101. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  102. newdiv.innerHTML = newdiv.innerHTML +
  103. "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
  104. "<tr>" +
  105. "<td id='paddingformultitop'>" +
  106. "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  107. "</td>" +
  108. "<td>" +
  109. "<input type='text' name='resdate_" + count + "' value=''  >&nbsp;&nbsp;" +
  110.  
  111. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  112. "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
  113. "</td>" +
  114. "<td>" +
  115.  
  116. "Resolution Verified as effective by:&nbsp;&nbsp;"  +
  117. "</td>" +
  118. "<td>" +
  119. "<select name='resvertified_" + count + "'>" +
  120. "<option value='' selected>Make A Selection</option>" +
  121. "<cfoutput query='gettech'><option value='#fname# #lname#'>#fname# #lname#</option></cfoutput></select>" +
  122. "</td>" +
  123. "</tr>" +
  124. "</table>";
  125.  
  126. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) and resolution vertified as effective by  --->
  127. newdiv.innerHTML = newdiv.innerHTML +
  128. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  129. "<tr>" +
  130. "<td id='paddingformultitop'>" +
  131. "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
  132. "</td>" +
  133. "<td class='vertificationmoveinmulti'>" +
  134. "<input type='text' name='vertifidate_" + count + "'>&nbsp;&nbsp;" +
  135. "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
  136. "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
  137. "</td>" +
  138. "</tr>" +
  139. "</table>";
  140.  
  141. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  142. newdiv.innerHTML = newdiv.innerHTML +
  143. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  144. "<tr>" +
  145. "<td class='red' id='paddingformultitop'>" +
  146. "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
  147. "<select name='deptvendor_" + count + "'>" +
  148. "<option value='' selected>Make A Selection</option>" +
  149. "<cfoutput query='getDeptVendor'>" +
  150. "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
  151. " </cfoutput>" +
  152. "</select>" +
  153. "</td>" +
  154. "</tr>" +
  155. "</table>";
  156.  
  157. <!--- Adds Extra fields for RMA Data Only  --->
  158. newdiv.innerHTML = newdiv.innerHTML +
  159. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  160. "<tr>" +
  161. "<td id='paddingformultitop'>" +
  162. "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
  163. "</td>" +
  164. "<td class='rmanmoveinmulti'>" +
  165. "( You may enter up to 500 characters. )"+
  166. "<br/>" +
  167. "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "'></textarea> " +
  168. "</td>" +
  169. "</tr>" +
  170. "</table>" +
  171. "<input type='hidden' name='serialcount' value='" + count + "'>";
  172.  
  173. <!--- Adds Delete to every ticket  --->
  174. newdiv.innerHTML = newdiv.innerHTML +
  175. "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
  176. "<tr>" +
  177. "<td>" +
  178. "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
  179. "</td>" +
  180. "</td>" +
  181. "</tr>" +
  182. "</table>";
  183.  
  184. document.getElementById(divName).appendChild(newdiv);
  185. } </script>
  186.  
  187. <body onload="dynamicInput">
  188. <input type="hidden" value="0" id="theValue" />
  189.      <div id="dynamicInput">
  190.      <!--- All Ticket Information Appears Here--->
  191.     <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
  192.  
  193. <cfoutput query="serial">
  194. <table class="zpExpandedTable" id="modeltable">
  195. <th class="sectiontitletick" colspan="7">Serial Information '#count#' </th>
  196. <tr></cfoutput>
  197. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  198. </td>
  199. <td>
  200. <select name="modelno_' + count + '">
  201. <option value="">Make A Selection</option>
  202. <cfoutput query="models">
  203. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  204. </cfoutput> 
  205. </select>
  206. </td>
  207. <td>
  208. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  209. </td>
  210. <td>
  211. <select name="producttype_' + count + '">
  212. <option value="" selected>No Choice</option>
  213. <cfoutput query="getProdType">
  214. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  215. </cfoutput>
  216. </select>
  217. </td>
  218. <td class="red'">
  219. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  220. </td>
  221. <td>
  222. <select name="hardwarefailure_' + count + '">
  223. <option value="" selected>Make A Selection</option>
  224. <cfoutput query="getHardwareFail">
  225. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  226. </cfoutput>
  227. </select>
  228. </td>
  229. </tr>
  230. <table>
  231.  
  232. <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
  233. <table class="zpExpandedTable" id="modeltable">
  234. <tr>
  235. <td id="paddingformultitop">
  236. Serial Number:&nbsp;&nbsp;
  237. <cfoutput query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfoutput>
  238. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  239. <select name="softhardware_' + count + '">
  240. <option value="" selected>No Choice</option>
  241. <cfoutput query="getSoftHard">
  242. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  243. </cfoutput>
  244. </select>
  245. </td>
  246. </tr>
  247. </table>
  248.  
  249. <!--- Adds Extra fields for Description ---> 
  250.  
  251. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  252. <tr>
  253. <td id="paddingformutli">
  254. Description:&nbsp;&nbsp;
  255. </td>
  256. <td class="descriptionmoveinmulti">
  257. ( You may enter up to 500 characters. )
  258. <br>
  259. <cfoutput query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfoutput> 
  260. </td>
  261. </tr>
  262. </table>
  263.  
  264. <!--- Adds Extra fields for Resolution  --->
  265.  
  266. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  267. <tr>
  268. <td id="paddingformutli">
  269. Resolution:&nbsp;&nbsp;
  270. </td>
  271. <td class="resolutionmoveinmulti">
  272. ( You may enter up to 500 characters. )
  273. <br>
  274. <cfoutput query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfoutput>
  275. </td>
  276. </tr>
  277. </table>
  278.  
  279. <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  280.  
  281. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  282. <tr>
  283. <td id="paddingformultitop">
  284. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  285. </td>
  286. <td>
  287. <cfoutput query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfoutput>
  288.  
  289. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  290. <input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>
  291.  
  292. </td>
  293. <td>
  294. Resolution Verified as effective by:&nbsp;&nbsp;
  295. </td>
  296. <td>
  297. <select name="resvertified_' + count + '">
  298. <option value="" selected>Make A Selection</option>
  299. <cfoutput query="gettech">
  300. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  301. </cfoutput>
  302. </select>
  303. </td>
  304. </tr>
  305. </table>
  306. <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
  307. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  308. <tr>
  309. <td id="paddingformultitop">
  310. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  311. </td>
  312. <td class="vertificationmoveinmulti">
  313. <cfoutput query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfoutput>
  314. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  315. <input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>
  316. </td>
  317. </tr>
  318. </table>
  319.  
  320. <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
  321. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  322. <tr>
  323. <td class="red" id="paddingformultitop">
  324. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  325. <select name="deptvendor_' + count + '">
  326. <option value="" selected>Make A Selection</option>
  327. <cfoutput query="getDeptVendor">
  328. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  329. </cfoutput>
  330. </select>
  331. </td>
  332. </tr>
  333. </table>
  334.  
  335. <!--- Adds Extra fields for RMA Data Only  --->
  336. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  337. <tr>
  338. <td id="paddingformultitop">
  339. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  340. </td>
  341. <td class="rmanmoveinmulti">
  342. ( You may enter up to 500 characters. )
  343. <br/>
  344. <cfoutput query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfoutput>
  345. </td>
  346. </tr>
  347. </table>
  348. <input type="hidden" name="serialcount" value="' + count + '">
  349.  
  350. <!--- Adds Delete to every ticket  --->
  351. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  352. <tr>
  353. <td>
  354. <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
  355. </td>
  356. </td>
  357. </tr>
  358. </table>
  359.  
  360.  
  361.  
  362.  
  363.  
  364.      </div>
  365.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
  366.  
Thank you again for all the help :),
Rach
Sep 23 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
That was only an example. #count# you'd have to set in your Coldfusion, e.g. on each loop iteration increase #count# by 1.
Sep 23 '08 #8
bonneylake
769 Contributor
That was only an example. #count# you'd have to set in your Coldfusion, e.g. on each loop iteration increase #count# by 1.
Hey Acoder,

But how would i apply the cfloop to this? the reason i ask is because theres so many different cfoutput cfquery for the drop down boxes in the whole form that i can't just put a cfloop around the whole thing so just wondering how i could apply that.

Thank you :),
Rach
Sep 23 '08 #9
acoder
16,027 Recognized Expert Moderator MVP
You could use cfloop instead of cfoutput for the inner queries
Sep 23 '08 #10

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

Similar topics

0
2944
by: Charles Alexander | last post by:
Hello I am new to php & MySQL - I am trying to retrieve some records from a MySQL table and redisplay them. The data in list form looks like this: Sample_ID Marker_ID Variation G23_NA17192.fsa rs7374540 A/C I23_Control.fsa rs7374540 C/C
6
4794
by: Ravi | last post by:
Hi All, I am trying to execute a select statement using the DBI module of perl in a for loop. I am getting a strange behaviour, the select statement is excuting correctly only for the last element in the for loop. I am including the portion of the code : #Get the connection to the database my $dbh = &getConnection(); my @acodes;
43
5607
by: Gremlin | last post by:
If you are not familiar with the halting problem, I will not go into it in detail but it states that it is impossible to write a program that can tell if a loop is infinite or not. This is a fallacy built on the assumption of mythical infinite all powerfull machines. In reality we deal with finite machines that are capable of two states in a loop, they either terminate, or repeat themselves. In the mythical halting problem scenario...
11
2035
by: Roman Töngi | last post by:
for (int i = 1; i <= 10; i++) cout << i << endl; I expected the following: 1 2 3 4 5 6
2
2689
by: Alex | last post by:
Compiler - Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland Linker - Turbo Incremental Link 5.65 Copyright (c) 1997-2002 Borland Platform - Win32 (XP) Quite by accident I stumbled across some wierd loop behavior. With the pasted code I receive the output that follows. I realize that the code is broken, because the inner loop fails to reset j for each iteration of the outer loop (the fix is commented out). I also know that...
63
3153
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
6
71984
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
16
3547
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of instructions which can sure be optimized away is the check for the break condition, at least within the time where it is known that the loop will not reach it. Any idea how to write such a loop? e.g.
2
19318
ADezii
by: ADezii | last post by:
If you are executing a code segment for a fixed number of iterations, always use a For...Next Loop instead of a Do...Loop, since it is significantly faster. Each pass through a Do...Loop that iterates a specified number of times, requires you to also implement or decrement some sort of Loop Counter, while a For...Next Loop does that work for you. Both Loops will provide the same results, but the For...Next Loop is substantially faster. One...
3
4488
by: numlock00 | last post by:
I have a nested 'while' loop that won't repeat, no matter how many times the outer loop repeats. The outer loop reads through an array of elements; the inner loop Ithe 'while' loop) is supposed to apply each of these elements while reading an input file. The outer loop is working fine. It will run through every element of the array. The inner loop, however, only runs once. Even though the outer loop finishes inormally, the inner loop does not...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.