473,698 Members | 2,588 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
60 5257
bonneylake
769 Contributor
You could use cfloop instead of cfoutput for the inner queries
hey acoder,

i made everything into a cfloop, but now it displays all my results as whatever i set the value to like for example #model_no#, any suggestions on what i am doing wrong?


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. <cfloop 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. </cfloop>
  14.  
  15. <!--- Ticket Information 
  16.        This display the ticket Information--->
  17.  
  18. <input type="hidden" value="0" id="theValue" />
  19.      <div id="dynamicInput">
  20.      <!--- All Ticket Information Appears Here--->
  21.     <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  22.  
  23.  
  24. <table class="zpExpandedTable" id="modeltable"> 
  25. <th class="sectiontitletick" colspan="7">Serial Information <!---#count#---> </th>
  26. <tr>
  27. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  28. </td>
  29. <td>
  30. <select name="modelno_' + count + '">
  31. <option value="">Make A Selection</option>
  32. <cfloop query="models">
  33. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  34. </cfloop> 
  35. </select>
  36. </td>
  37. <td>
  38. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  39. </td>
  40. <td>
  41. <select name="producttype_' + count + '">
  42. <option value="" selected>No Choice</option>
  43. <cfloop query="getProdType">
  44. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  45. </cfloop>
  46. </select>
  47. </td>
  48. <td class="red'">
  49. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  50. </td>
  51. <td>
  52. <select name="hardwarefailure_' + count + '">
  53. <option value="" selected>Make A Selection</option>
  54. <cfloop query="getHardwareFail">
  55. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  56. </cfloop>
  57. </select>
  58. </td>
  59. </tr>
  60. <table>
  61.  
  62. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  63. <table class="zpExpandedTable" id="modeltable">
  64. <tr>
  65. <td id="paddingformultitop">
  66. Serial Number:&nbsp;&nbsp;
  67. <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
  68. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  69. <select name="softhardware_' + count + '">
  70. <option value="" selected>No Choice</option>
  71. <cfloop query="getSoftHard">
  72. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  73. </cfloop>
  74. </select>
  75. </td>
  76. </tr>
  77. </table>
  78.  
  79. <!--- Shows what was previously entered for Description ---> 
  80.  
  81. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  82. <tr>
  83. <td id="paddingformutli">
  84. Description:&nbsp;&nbsp;
  85. </td>
  86. <td class="descriptionmoveinmulti">
  87. ( You may enter up to 500 characters. )
  88. <br>
  89. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
  90. </td>
  91. </tr>
  92. </table>
  93.  
  94. <!---Shows what was previously entered for Resolution  --->
  95.  
  96. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  97. <tr>
  98. <td id="paddingformutli">
  99. Resolution:&nbsp;&nbsp;
  100. </td>
  101. <td class="resolutionmoveinmulti">
  102. ( You may enter up to 500 characters. )
  103. <br>
  104. <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
  105. </td>
  106. </tr>
  107. </table>
  108.  
  109. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  110.  
  111. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  112. <tr>
  113. <td id="paddingformultitop">
  114. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  115. </td>
  116. <td>
  117. <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
  118.  
  119. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  120. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  121.  
  122. </td>
  123. <td>
  124. Resolution Verified as effective by:&nbsp;&nbsp;
  125. </td>
  126. <td>
  127. <select name="resvertified_' + count + '">
  128. <option value="" selected>Make A Selection</option>
  129. <cfloop query="gettech">
  130. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  131. </cfloop>
  132. </select>
  133. </td>
  134. </tr>
  135. </table>
  136. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  137. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  138. <tr>
  139. <td id="paddingformultitop">
  140. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  141. </td>
  142. <td class="vertificationmoveinmulti">
  143. <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
  144. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  145. <!---<input type="checkbox" name="currentdatevert_' + count + '" 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 500 characters. )
  173. <br/>
  174. <cfloop query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfloop>
  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 &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
  185. </td>
  186. </td>
  187. </tr>
  188. </table>
  189.  
  190.  
  191.  
  192.  
  193.  
  194.      </div>
  195.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
Thank you,
Rach
Sep 23 '08 #11
acoder
16,027 Recognized Expert Moderator MVP
The outer loop should be cfoutput of course.
Sep 23 '08 #12
bonneylake
769 Contributor
The outer loop should be cfoutput of course.
Hey Acoder,

I put the cfoutput around what is inside the div but it still not looping through it an is still displaying everything side by side. do i do that part where i do the loop iteration and increase it by 1 to make it go into its own little sections?and if so how would i go about it?

here is what i have inside the div right now

Expand|Select|Wrap|Line Numbers
  1. <cfoutput>
  2. <table class="zpExpandedTable" id="modeltable"> 
  3. <th class="sectiontitletick" colspan="7">Serial Information <!---#count#---> </th>
  4. <tr>
  5. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  6. </td>
  7. <td>
  8. <select name="modelno_' + count + '">
  9. <option value="">Make A Selection</option>
  10. <cfloop query="models">
  11. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  12. </cfloop> 
  13. </select>
  14. </td>
  15. <td>
  16. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  17. </td>
  18. <td>
  19. <select name="producttype_' + count + '">
  20. <option value="" selected>No Choice</option>
  21. <cfloop query="getProdType">
  22. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  23. </cfloop>
  24. </select>
  25. </td>
  26. <td class="red'">
  27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  28. </td>
  29. <td>
  30. <select name="hardwarefailure_' + count + '">
  31. <option value="" selected>Make A Selection</option>
  32. <cfloop query="getHardwareFail">
  33. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  34. </cfloop>
  35. </select>
  36. </td>
  37. </tr>
  38. <table>
  39.  
  40. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  41. <table class="zpExpandedTable" id="modeltable">
  42. <tr>
  43. <td id="paddingformultitop">
  44. Serial Number:&nbsp;&nbsp;
  45. <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
  46. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  47. <select name="softhardware_' + count + '">
  48. <option value="" selected>No Choice</option>
  49. <cfloop query="getSoftHard">
  50. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  51. </cfloop>
  52. </select>
  53. </td>
  54. </tr>
  55. </table>
  56.  
  57. <!--- Shows what was previously entered for Description ---> 
  58.  
  59. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  60. <tr>
  61. <td id="paddingformutli">
  62. Description:&nbsp;&nbsp;
  63. </td>
  64. <td class="descriptionmoveinmulti">
  65. ( You may enter up to 500 characters. )
  66. <br>
  67. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
  68. </td>
  69. </tr>
  70. </table>
  71.  
  72. <!---Shows what was previously entered for Resolution  --->
  73.  
  74. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  75. <tr>
  76. <td id="paddingformutli">
  77. Resolution:&nbsp;&nbsp;
  78. </td>
  79. <td class="resolutionmoveinmulti">
  80. ( You may enter up to 500 characters. )
  81. <br>
  82. <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
  83. </td>
  84. </tr>
  85. </table>
  86.  
  87. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  88.  
  89. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  90. <tr>
  91. <td id="paddingformultitop">
  92. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  93. </td>
  94. <td>
  95. <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
  96.  
  97. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  98. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  99.  
  100. </td>
  101. <td>
  102. Resolution Verified as effective by:&nbsp;&nbsp;
  103. </td>
  104. <td>
  105. <select name="resvertified_' + count + '">
  106. <option value="" selected>Make A Selection</option>
  107. <cfloop query="gettech">
  108. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  109. </cfloop>
  110. </select>
  111. </td>
  112. </tr>
  113. </table>
  114. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  115. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  116. <tr>
  117. <td id="paddingformultitop">
  118. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  119. </td>
  120. <td class="vertificationmoveinmulti">
  121. <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
  122. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  123. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  124. </td>
  125. </tr>
  126. </table>
  127.  
  128. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  129. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  130. <tr>
  131. <td class="red" id="paddingformultitop">
  132. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  133. <select name="deptvendor_' + count + '">
  134. <option value="" selected>Make A Selection</option>
  135. <cfloop query="getDeptVendor">
  136. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  137. </cfloop>
  138. </select>
  139. </td>
  140. </tr>
  141. </table>
  142.  
  143. <!--- Shows what was previously entered for RMA Data Only  --->
  144. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  145. <tr>
  146. <td id="paddingformultitop">
  147. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  148. </td>
  149. <td class="rmanmoveinmulti">
  150. ( You may enter up to 500 characters. )
  151. <br/>
  152. <cfloop query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfloop>
  153. </td>
  154. </tr>
  155. </table>
  156. <input type="hidden" name="serialcount" value="' + count + '">
  157.  
  158. <!--- Adds Delete to every ticket  --->
  159. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  160. <tr>
  161. <td>
  162. <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
  163. </td>
  164. </td>
  165. </tr>
  166. </table>
  167. </cfoutput>
Thank you,
Rach
Sep 23 '08 #13
bonneylake
769 Contributor
Hey Acoder,

well its looping (sorta). it atleast is recognizing 3 records and make 3 separate serial information. but it i is still displaying everything side by side except in 3 seperate serial information. how do i make it so each serial has its own serial information section?

here is what i have inside the div right now

Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="serial">
  2. <table class="zpExpandedTable" id="modeltable"> 
  3. <th class="sectiontitletick" colspan="7">Serial Information <!---#count# ---></th>
  4. <tr>
  5. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  6. </td>
  7. <td>
  8. <select name="modelno_' + count + '">
  9. <option value="">Make A Selection</option>
  10. <cfloop query="models">
  11. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  12. </cfloop> 
  13. </select>
  14. </td>
  15. <td>
  16. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  17. </td>
  18. <td>
  19. <select name="producttype_' + count + '">
  20. <option value="" selected>No Choice</option>
  21. <cfloop query="getProdType">
  22. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  23. </cfloop>
  24. </select>
  25. </td>
  26. <td class="red'">
  27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  28. </td>
  29. <td>
  30. <select name="hardwarefailure_' + count + '">
  31. <option value="" selected>Make A Selection</option>
  32. <cfloop query="getHardwareFail">
  33. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  34. </cfloop>
  35. </select>
  36. </td>
  37. </tr>
  38. <table>
  39.  
  40. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  41. <table class="zpExpandedTable" id="modeltable">
  42. <tr>
  43. <td id="paddingformultitop">
  44. Serial Number:&nbsp;&nbsp;
  45. <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
  46. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  47. <select name="softhardware_' + count + '">
  48. <option value="" selected>No Choice</option>
  49. <cfloop query="getSoftHard">
  50. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  51. </cfloop>
  52. </select>
  53. </td>
  54. </tr>
  55. </table>
  56.  
  57. <!--- Shows what was previously entered for Description ---> 
  58.  
  59. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  60. <tr>
  61. <td id="paddingformutli">
  62. Description:&nbsp;&nbsp;
  63. </td>
  64. <td class="descriptionmoveinmulti">
  65. ( You may enter up to 500 characters. )
  66. <br>
  67. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
  68. </td>
  69. </tr>
  70. </table>
  71.  
  72. <!---Shows what was previously entered for Resolution  --->
  73.  
  74. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  75. <tr>
  76. <td id="paddingformutli">
  77. Resolution:&nbsp;&nbsp;
  78. </td>
  79. <td class="resolutionmoveinmulti">
  80. ( You may enter up to 500 characters. )
  81. <br>
  82. <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
  83. </td>
  84. </tr>
  85. </table>
  86.  
  87. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  88.  
  89. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  90. <tr>
  91. <td id="paddingformultitop">
  92. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  93. </td>
  94. <td>
  95. <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
  96.  
  97. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  98. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  99.  
  100. </td>
  101. <td>
  102. Resolution Verified as effective by:&nbsp;&nbsp;
  103. </td>
  104. <td>
  105. <select name="resvertified_' + count + '">
  106. <option value="" selected>Make A Selection</option>
  107. <cfloop query="gettech">
  108. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  109. </cfloop>
  110. </select>
  111. </td>
  112. </tr>
  113. </table>
  114. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  115. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  116. <tr>
  117. <td id="paddingformultitop">
  118. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  119. </td>
  120. <td class="vertificationmoveinmulti">
  121. <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
  122. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  123. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  124. </td>
  125. </tr>
  126. </table>
  127.  
  128. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  129. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  130. <tr>
  131. <td class="red" id="paddingformultitop">
  132. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  133. <select name="deptvendor_' + count + '">
  134. <option value="" selected>Make A Selection</option>
  135. <cfloop query="getDeptVendor">
  136. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  137. </cfloop>
  138. </select>
  139. </td>
  140. </tr>
  141. </table>
  142.  
  143. <!--- Shows what was previously entered for RMA Data Only  --->
  144. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  145. <tr>
  146. <td id="paddingformultitop">
  147. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  148. </td>
  149. <td class="rmanmoveinmulti">
  150. ( You may enter up to 500 characters. )
  151. <br/>
  152. <cfloop query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfloop>
  153. </td>
  154. </tr>
  155. </table>
  156. <input type="hidden" name="serialcount" value="' + count + '">
  157.  
  158. <!--- Adds Delete to every ticket  --->
  159. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  160. <tr>
  161. <td>
  162. <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
  163. </td>
  164. </td>
  165. </tr>
  166. </table>
  167. </cfoutput>
Thank you,
Rach[/quote]
Sep 23 '08 #14
acoder
16,027 Recognized Expert Moderator MVP
Does it show three "Serial Information" headers?

You can increment the #count# (set it to 1 to begin with) at the end of the loop:
Expand|Select|Wrap|Line Numbers
  1. <cfset count = count + 1>
I've not seen the CSS classes, so not sure how that affects things, but if it's showing side by side, then you could add some spacing at the bottom (end of the loop), e.g. a couple of <br> tags.
Sep 24 '08 #15
bonneylake
769 Contributor
Does it show three "Serial Information" headers?

You can increment the #count# (set it to 1 to begin with) at the end of the loop:
Expand|Select|Wrap|Line Numbers
  1. <cfset count = count + 1>
I've not seen the CSS classes, so not sure how that affects things, but if it's showing side by side, then you could add some spacing at the bottom (end of the loop), e.g. a couple of <br> tags.
Hey Acoder,

Yes it shows 3 serial information headers. Just shows all the fields next to each other.

example

serial information 1

serial 1, serial 2, serial 3

serial information 2

serial 1, serial 2, serial 3

an what i am trying to do is

serial information 1

serial 1

serial information 2

serial 2

I don't think the css has to do with anything because it only makes the design (color, align center), the only thing that could affect is is the table. but do i think i need to change the table to accomplish this?

Expand|Select|Wrap|Line Numbers
  1.     <div id="dynamicInput">
  2.      <!--- All Ticket Information Appears Here--->
  3.     <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4.  
  5. <cfoutput query="serial">
  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>
  19. </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. <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. <cfloop query="serial" ><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
  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. </td>
  59. </tr>
  60. </table>
  61.  
  62. <!--- Shows what was previously entered for Description ---> 
  63.  
  64. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  65. <tr>
  66. <td id="paddingformutli">
  67. Description:&nbsp;&nbsp;
  68. </td>
  69. <td class="descriptionmoveinmulti">
  70. ( You may enter up to 500 characters. )
  71. <br>
  72. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
  73. </td>
  74. </tr>
  75. </table>
  76.  
  77. <!---Shows what was previously entered for Resolution  --->
  78.  
  79. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  80. <tr>
  81. <td id="paddingformutli">
  82. Resolution:&nbsp;&nbsp;
  83. </td>
  84. <td class="resolutionmoveinmulti">
  85. ( You may enter up to 500 characters. )
  86. <br>
  87. <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
  88. </td>
  89. </tr>
  90. </table>
  91.  
  92. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  93.  
  94. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  95. <tr>
  96. <td id="paddingformultitop">
  97. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  98. </td>
  99. <td>
  100. <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
  101.  
  102. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  103. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  104.  
  105. </td>
  106. <td>
  107. Resolution Verified as effective by:&nbsp;&nbsp;
  108. </td>
  109. <td>
  110. <select name="resvertified_' + count + '">
  111. <option value="" selected>Make A Selection</option>
  112. <cfloop query="gettech">
  113. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  114. </cfloop>
  115. </select>
  116. </td>
  117. </tr>
  118. </table>
  119. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  120. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  121. <tr>
  122. <td id="paddingformultitop">
  123. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  124. </td>
  125. <td class="vertificationmoveinmulti">
  126. <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
  127. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  128. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  129. </td>
  130. </tr>
  131. </table>
  132.  
  133. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  134. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  135. <tr>
  136. <td class="red" id="paddingformultitop">
  137. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  138. <select name="deptvendor_' + count + '">
  139. <option value="" selected>Make A Selection</option>
  140. <cfloop query="getDeptVendor">
  141. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  142. </cfloop>
  143. </select>
  144. </td>
  145. </tr>
  146. </table>
  147.  
  148. <!--- Shows what was previously entered for RMA Data Only  --->
  149. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  150. <tr>
  151. <td id="paddingformultitop">
  152. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  153. </td>
  154. <td class="rmanmoveinmulti">
  155. ( You may enter up to 500 characters. )
  156. <br/>
  157. <cfloop query="serial"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea></cfloop>
  158. </td>
  159. </tr>
  160. </table>
  161. <input type="hidden" name="serialcount" value="' + count + '">
  162.  
  163. <!--- Adds Delete to every ticket  --->
  164. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  165. <tr>
  166. <td>
  167. <!---<input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\">--->
  168. </td>
  169. </td>
  170. </tr>
  171. </table>
  172. </cfoutput>
  173.  
  174.      </div>
also wanted to ask the way am doing it, is it going to have a problem with the count? because original the way it keeps count of everything added and deleted was using the javascript. an i am afraid of is if i have a serial information 1 in the div and i go an add a serial and its called serial information 1 that it will get over written instead of keeping the original serial information 1 and adding the other serial information 1. Hope that makes since mostly worried about the count an how that will work since now its not in the javascript.

Thank you for all the help,
Rach
Sep 24 '08 #16
acoder
16,027 Recognized Expert Moderator MVP
Within the code you have <cfloop query="serial"> This is the cause of the problem. It's looping within the loop. Remove the "serial" loops. You can keep the rest because they're just populating drop downs, etc., though you could probably have it grab the output in variable and output that instead of looping over the same queries over and over again.

As for the JavaScript, that can be solved by outputting the Coldfusion count variable within the JavaScript code.
Sep 24 '08 #17
bonneylake
769 Contributor
Hey Acoder,

Yep that works, can't believe i didn't notice it! But ok so how do i output the coldfusion count variable within the javascript code?

Thank you :),
Rach
Sep 24 '08 #18
acoder
16,027 Recognized Expert Moderator MVP
Something as simple as
Expand|Select|Wrap|Line Numbers
  1. var count = <cfoutput>#count#</cfoutput>;
This assumes that the count value in Coldfusion is correct, of course.
Sep 24 '08 #19
bonneylake
769 Contributor
Something as simple as
Expand|Select|Wrap|Line Numbers
  1. var count = <cfoutput>#count#</cfoutput>;
This assumes that the count value in Coldfusion is correct, of course.
Hey Acoder,

Ok so me and count are not getting along so well (havent added what you added above just yet). But i get the error of Error resolving parameter COUNT here is what i have tried

Expand|Select|Wrap|Line Numbers
  1. <div id="dynamicInput">
  2.      <!--- All Ticket Information Appears Here--->
  3.     <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  4.  
  5.  
  6. <cfset count = count + 1>
  7. <cfoutput query="serial">
  8.  
  9. <cfset model_no = #model_no#>
  10. <cfset product_type = #product_type#>
  11. <cfset type_hardware_failure = #type_hardware_failure#>
  12. <cfset software_hardware = #software_hardware#>
  13. <cfset resolution_verified_by = #resolution_verified_by#>
  14. <cfset dept_responsibility = #dept_responsibility#>
  15. <table class="zpExpandedTable" id="modeltable"> 
  16. <th class="sectiontitletick" colspan="7">
  17. Serial Information #count# </th>
  18. <tr>
Do i need to do something like <cfset count = 0> before the cfset you have?

Thank you,
Rach
Sep 24 '08 #20

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

Similar topics

0
2934
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
4789
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
5580
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
2026
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
2679
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
71972
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
3523
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
19306
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
4483
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
8680
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
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
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
8871
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
6528
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
4371
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
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.