473,836 Members | 1,412 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 5288
acoder
16,027 Recognized Expert Moderator MVP
Ah, I see you use the "theValue" hidden input for the count. In that case instead of setting a global variable, set the hidden variable and you can set it directly without using javascript:
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" value="#count#" id="theValue" />
Sep 24 '08 #31
bonneylake
769 Contributor
Ah, I see you use the "theValue" hidden input for the count. In that case instead of setting a global variable, set the hidden variable and you can set it directly without using javascript:
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" value="#count#" id="theValue" />
Hey Acoder,

I am still running into the same problem. I bolded where i added it at an have not messed with the javascript.

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" value="0" id="theValue" />
  2.      <div id="dynamicInput">
  3.      <!--- All Ticket Information Appears Here--->
  4.     <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
  5.  
  6. <cfset count = 0>
  7. <cfoutput query="serial">
  8. <cfset model_no = #model_no#>
  9. <cfset product_type = #product_type#>
  10. <cfset type_hardware_failure = #type_hardware_failure#>
  11. <cfset software_hardware = #software_hardware#>
  12. <cfset resolution_verified_by = #resolution_verified_by#>
  13. <cfset dept_responsibility = #dept_responsibility#>
  14. <table class="zpExpandedTable" id="modeltable"> 
  15. <th class="sectiontitletick" colspan="7">
  16. <cfset count = count + 1>
  17. Serial Information #count# </th>
  18. <tr>
  19. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  20. </td>
  21. <td>
  22. <select name="modelno_' + count + '">
  23. <option value="">Make A Selection</option>
  24. <cfloop query="models">
  25. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  26. </cfloop> 
  27. </select>
  28. </td>
  29. <td>
  30. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  31. </td>
  32. <td>
  33. <select name="producttype_' + count + '">
  34. <option value="" selected>No Choice</option>
  35. <cfloop query="getProdType">
  36. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  37. </cfloop>
  38. </select>
  39. </td>
  40. <td class="red'">
  41. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  42. </td>
  43. <td>
  44. <select name="hardwarefailure_' + count + '">
  45. <option value="" selected>Make A Selection</option>
  46. <cfloop query="getHardwareFail">
  47. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  48. </cfloop>
  49. </select>
  50. </td>
  51. </tr>
  52. <table>
  53.  
  54. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  55. <table class="zpExpandedTable" id="modeltable">
  56. <tr>
  57. <td id="paddingformultitop">
  58. Serial Number:&nbsp;&nbsp;
  59. <input type="text" name="serialnum_' + count + '" value="#pka_serialNo#">
  60. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  61. <select name="softhardware_' + count + '">
  62. <option value="" selected>No Choice</option>
  63. <cfloop query="getSoftHard">
  64. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  65. </cfloop>
  66. </select>
  67. </td>
  68. </tr>
  69. </table>
  70.  
  71. <!--- Shows what was previously entered for Description ---> 
  72.  
  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. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
  82. </td>
  83. </tr>
  84. </table>
  85.  
  86. <!---Shows what was previously entered for Resolution  --->
  87.  
  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 + '">#resolution#</textarea>
  97. </td>
  98. </tr>
  99. </table>
  100.  
  101. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  102.  
  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="#resolution_date#">&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.  
  114. </td>
  115. <td>
  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. <cfloop query="gettech">
  122. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  123. </cfloop>
  124. </select>
  125. </td>
  126. </tr>
  127. </table>
  128. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  129. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  130. <tr>
  131. <td id="paddingformultitop">
  132. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  133. </td>
  134. <td class="vertificationmoveinmulti">
  135. <input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;
  136. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  137. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  138. </td>
  139. </tr>
  140. </table>
  141.  
  142. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  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. <cfloop query="getDeptVendor">
  150. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  151. </cfloop>
  152. </select>
  153. </td>
  154. </tr>
  155. </table>
  156.  
  157. <!--- Shows what was previously entered for RMA Data Only  --->
  158. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  159. <tr>
  160. <td id="paddingformultitop">
  161. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  162. </td>
  163. <td class="rmanmoveinmulti">
  164. ( You may enter up to 500 characters. )
  165. <br/>
  166. <textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_' + count + '" >#rma_data#</textarea>
  167. </td>
  168. </tr>
  169. </table><input type="hidden" value="#count#" id="theValue" />
  170. <input type="hidden" name="serialcount" value="' + count + '">
  171.  
  172. <!--- Adds Delete to every ticket  --->
  173. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  174. <tr>
  175. <td>
  176. <!---<input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\">--->
  177. </td>
  178. </tr>
  179. </table>
  180.  
  181.      </div>
  182. </cfoutput>
  183.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
Thank you,
Rach
Sep 24 '08 #32
acoder
16,027 Recognized Expert Moderator MVP
The first thing to check is that it's within cfoutput. Also don't forget to remove the first line which has a duplicate (now no longer needed).
Sep 24 '08 #33
bonneylake
769 Contributor
The first thing to check is that it's within cfoutput. Also don't forget to remove the first line which has a duplicate (now no longer needed).
Hey Acoder,

Well taking out the first line the value part seemed to help the count better. If i have one previously serial it seems to work perfectly the count. But if have more the one is when i run into problems. If i have serial 1 and serial 2 if i go to add another it makes it serial 2. But new line is within the cfouput. But here is what i have

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

That didn't seem to do anything to it. But i do got another question to ask you, i have a part in the form called remove an well was wondering how i could change this from javascript to html. i understand till the count part but past that i can't seem to get it right and get errors when i tried. here is what i have

Expand|Select|Wrap|Line Numbers
  1. <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\">
but here is the beginning of the javascript if you want to see it again
Expand|Select|Wrap|Line Numbers
  1. function addInput(divName){
  2. var dynamic = document.getElementById('dynamicInput');
  3. var thevalue = document.getElementById('theValue');
  4. <!---var count = parseInt(document.getElementById('theValue').value )+ 1;--->
  5. var count = (document.getElementById('theValue').value -1)+ 2;
  6. thevalue.value = count;
  7. var newdiv = document.createElement('div');
  8. var divIdName = 'dynamic'+count+'Input';
  9. newdiv.setAttribute('id',divIdName);
Thank you again for all the help :),
Rach
Sep 25 '08 #36
acoder
16,027 Recognized Expert Moderator MVP
That could be something like:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('#divIdName#')">
Where is this going to go?

For the count, check the value in the source. Say with two records, is it two? In addInput (the JavaScript function), check the value of theValue.
Sep 25 '08 #37
bonneylake
769 Contributor
That could be something like:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('#divIdName#')">
Where is this going to go?

For the count, check the value in the source. Say with two records, is it two? In addInput (the JavaScript function), check the value of theValue.
Hey Acoder,

The remove part is going where you see the previously entered fields. The serial can add and remove fields (an needs to be able to remove previously entered fields and not just the new serials added).

but i looked at the source an its strange although it says serial information 2 twice (if i click add serial) it only shows serial information 1 and serial information 2 but does not show what i just added, it shows the previously added fields but does not show when i click add serial. I also just noticed that when i click add this is what happens.

serial information 1
displays previous entry

serial information 2
displays nothing

serial information 2
displays previous entry

i am not sure if that means anything. an in the javascript how do i make it check the value of theValue. because doesn't it do it right here or am i confused?
Expand|Select|Wrap|Line Numbers
  1. var count = (document.getElementById('theValue').value -1)+ 2;
  2. thevalue.value = count;
Thank you,
Rach
Sep 25 '08 #38
acoder
16,027 Recognized Expert Moderator MVP
For the remove button to work, you're going to have to enclose each previously entered ticket in a div with a unique id, so that you can pass that to the remove function. This ID can be what you use in JavaScript, i.e. "dynamic#count# Input".

The source will only show the source on page load. It won't show the code generated by JavaScript (though some browsers can allow you to see that with addons, for example).

From what you describe, it seems that the addInput is adding the table in between the two serials rather than at the end. Check the HTML tags all match up correctly and you haven't got tags mixed up, e.g. the closing div tag in the loop.
Sep 26 '08 #39
bonneylake
769 Contributor
For the remove button to work, you're going to have to enclose each previously entered ticket in a div with a unique id, so that you can pass that to the remove function. This ID can be what you use in JavaScript, i.e. "dynamic#count# Input".

The source will only show the source on page load. It won't show the code generated by JavaScript (though some browsers can allow you to see that with addons, for example).

From what you describe, it seems that the addInput is adding the table in between the two serials rather than at the end. Check the HTML tags all match up correctly and you haven't got tags mixed up, e.g. the closing div tag in the loop.
Hey Acoder,

Ok i got the addInput to work better now (you was right the closeing div tag was inside the loop). But here is what it is doing now. the serial 1 and 2 are the ones i previously entered and the serial 2 below the first serial 2 and 3 are ones that i added. but here is an example of how it looks

serial information 1
serial information 2
serial information 2
serial information 3

i created a new div but i don't think i did it correctly. An i am getting errors with the remove button saying undetermined string constant.

i bolded everything i added/changed. here is everything inside the div

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. <cfset count = 0>
  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. <cfif serial.recordcount is 0></cfif>
  14. <cfset count = count + 1>
  15. <div id="dynamic#count#Input">
  16. <table class="zpExpandedTable" id="modeltable"> 
  17. <th class="sectiontitletick" colspan="7">
  18. Serial Information #count# </th>
  19. <tr>
  20. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  21. </td>
  22. <td>
  23. <select name="modelno_#count#">
  24. <option value="">Make A Selection</option>
  25. <cfloop query="models">
  26. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  27. </cfloop> 
  28. </select>
  29.  
  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. <cfloop query="getProdType">
  38. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  39. </cfloop>
  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. <cfloop query="getHardwareFail">
  49. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  50. </cfloop>
  51. </select>
  52. </td>
  53. </tr>
  54. <table>
  55.  
  56. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  57. <table class="zpExpandedTable" id="modeltable">
  58. <tr>
  59. <td id="paddingformultitop">
  60. Serial Number:&nbsp;&nbsp;
  61. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  62. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  63. <select name="softhardware_#count#">
  64. <option value="" selected>No Choice</option>
  65. <cfloop query="getSoftHard">
  66. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  67. </cfloop>
  68. </select>
  69. </td>
  70. </tr>
  71. </table>
  72.  
  73. <!--- Shows what was previously entered for Description ---> 
  74.  
  75. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  76. <tr>
  77. <td id="paddingformutli">
  78. Description:&nbsp;&nbsp;
  79. </td>
  80. <td class="descriptionmoveinmulti">
  81. ( You may enter up to 500 characters. )
  82. <br>
  83. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_#count#">#description#</textarea></cfloop> 
  84. </td>
  85. </tr>
  86. </table>
  87.  
  88. <!---Shows what was previously entered for Resolution  --->
  89.  
  90. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  91. <tr>
  92. <td id="paddingformutli">
  93. Resolution:&nbsp;&nbsp;
  94. </td>
  95. <td class="resolutionmoveinmulti">
  96. ( You may enter up to 500 characters. )
  97. <br>
  98. <textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  99. </td>
  100. </tr>
  101. </table>
  102.  
  103. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  104.  
  105. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  106. <tr>
  107. <td id="paddingformultitop">
  108. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  109. </td>
  110. <td>
  111. <input type="text" name="resdate_#count#" value="#resolution_date#">&nbsp;&nbsp;
  112.  
  113. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  114. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  115.  
  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. <cfloop query="gettech">
  124. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  125. </cfloop>
  126. </select>
  127. </td>
  128. </tr>
  129. </table>
  130. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  131. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  132. <tr>
  133. <td id="paddingformultitop">
  134. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  135. </td>
  136. <td class="vertificationmoveinmulti">
  137. <input type="text" name="vertifidate_#count#" value="#verification_date#">&nbsp;&nbsp;
  138. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  139. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  140. </td>
  141. </tr>
  142. </table>
  143.  
  144. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  145. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  146. <tr>
  147. <td class="red" id="paddingformultitop">
  148. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  149. <select name="deptvendor_#count#">
  150. <option value="" selected>Make A Selection</option>
  151. <cfloop query="getDeptVendor">
  152. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  153. </cfloop>
  154. </select>
  155. </td>
  156. </tr>
  157. </table>
  158.  
  159. <!--- Shows what was previously entered for RMA Data Only  --->
  160. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  161. <tr>
  162. <td id="paddingformultitop">
  163. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  164. </td>
  165. <td class="rmanmoveinmulti">
  166. ( You may enter up to 500 characters. )
  167. <br/>
  168. <textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_#count#" >#rma_data#</textarea>
  169. </td>
  170. </tr>
  171. </table>
  172. <input type="hidden" value="#count#" name="theValue" id="theValue" />
  173. <input type="hidden" name="serialcount" value="#count#">
  174.  
  175. <!--- Adds Delete to every ticket  --->
  176. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  177. <tr>
  178. <td>
  179. <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('#divIdName#')">
  180. </td>
  181. </tr>
  182. </table>
  183. </div>
  184. </cfoutput>
  185. </div>
  186.      <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
an didn't know if you wanted to see this but here is the javascript

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

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

Similar topics

0
2946
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
4798
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
5612
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
2036
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
71985
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
3555
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
19325
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
4489
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
9820
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
9671
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
10549
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...
0
10254
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...
0
9376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7792
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
5828
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
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.