how to loop through this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bonneylake
    Contributor
    • Aug 2008
    • 769

    how to loop through this?

    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
    Code:
    <cfquery name="serial" datasource="CustomerSupport">
    		SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
             verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
    </cfquery>
    
    <cfoutput query="serial">
    <cfset model_no = #model_no#>
    <cfset product_type = #product_type#>
    <cfset type_hardware_failure = #type_hardware_failure#>
    <cfset software_hardware = #software_hardware#>
    <cfset resolution_verified_by = #resolution_verified_by#>
    <cfset dept_responsibility = #dept_responsibility#>
    </cfoutput>
    
    <script type="text/javascript">
    
    <!---Allows us to show previous fields --->
    
    function showInput(divName){
    var dynamic = document.getElementById('dynamicInput');
    var thevalue = document.getElementById('theValue');
    var count = (document.getElementById('theValue').value -1)+ 2;
    thevalue.value = count;
    var newdiv = document.createElement('div');
    var divIdName = 'dynamic'+count+'Input';
    newdiv.setAttribute('id',divIdName);
     
    
    <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
    newdiv.innerHTML =
    
    "<table class='zpExpandedTable' id='modeltable'>" +
    "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
    "<tr>" +
    "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
    "</td>" +
    "<td>" +
     "<select name='modelno_" + count + "'>" +
     "<option value=''>Make A Selection</option>" +
    "<cfoutput query='models'>" + 
    "<option value='#model#'<cfif #model# is #evaluate(model_no)#>selected</cfif>>#model#</option>" + 
    "</cfoutput>" + 
     "</select>" +
     "</td>" +
     "<td>" +
    "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
    "</td>" +
    "<td>" +
    "<select name='producttype_" + count + "'>" +
    "<option value='' selected>No Choice</option>" +
    "<cfoutput query='getProdType'>" + 
    "<option value='#pk_productType#'<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option>" + 
    "</cfoutput>" + 
    "</select>" +
    "</td>" +
    "<td class='red'>" +
    "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
    "</td>" +
    "<td>" +
    "<select name='hardwarefailure_" + count + "'>" +
    "<option value='' selected>Make A Selection</option>" +
    "<cfoutput query='getHardwareFail'>" +
    "<option value='#pk_hardwareFailure#'<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>" +
    "</cfoutput>" +
    "</select>" +
    "</td>" +
    "</tr>" +
    "<table>";
     
    <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='modeltable'>" +
    "<tr>" +
    "<td id='paddingformultitop'>" +
    "Serial Number:&nbsp;&nbsp;" +
    "<cfoutput query="serial"><input type='text' name='serialnum_" + count + "' value='#pka_serialNo#' ></cfoutput>" +
    "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
    "<select name='softhardware_" + count + "'>" +
    "<option value='' selected>No Choice</option>" +
    "<cfoutput query='getSoftHard'>" + 
    "<option value='#pk_softwareHardware#'<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>" + 
    "</cfoutput>" + 
    "</select>" +
    "</td>" +
    "</tr>" +
    "</table>";
    
    <!--- Adds Extra fields for Description ---> 
    newdiv.innerHTML = newdiv.innerHTML + 
    "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
    "<tr>" +
    "<td id='paddingformutli'>" +
    "Description:&nbsp;&nbsp;" + 
    "</td>" +
    "<td class='descriptionmoveinmulti'>" +
    "( You may enter up to 500 characters. )"+
    "<br>" +
    "<cfoutput query="description"><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'>#description#</textarea></cfoutput>" + 
    "</td>" +
    "</tr>" +
    "</table>";
     
    <!--- Adds Extra fields for Resolution  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td id='paddingformutli'>" +
    "Resolution:&nbsp;&nbsp;" +
    "</td>" +
    "<td class='resolutionmoveinmulti'>" +
    "( You may enter up to 500 characters. )"+
    "<br>" +
    "<cfoutput query='serial'><textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'>#resolution#</textarea></cfoutput>" +
    "</td>" +
    "</tr>" +
    "</table>";
     
    <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td id='paddingformultitop'>" +
    "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
    "</td>" +
    "<td>" +
    "<cfoutput query='serial'><input type='text' name='resdate_" + count + "' value='#resolution_date#'>&nbsp;&nbsp;</cfoutput>" +
     
    "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
    "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
    "</td>" +
    "<td>" +
    "Resolution Verified as effective by:&nbsp;&nbsp;"  +
    "</td>" +
    "<td>" +
    "<select name='resvertified_" + count + "'>" +
    "<option value='' selected>Make A Selection</option>" +
    "<cfoutput query='gettech'>" +
    "<option value='#fname# #lname#'<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>" +
    " </cfoutput>" +
    "</select>" +
    "</td>" +
    "</tr>" +
    "</table>";
    
     
    <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td id='paddingformultitop'>" +
    "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
    "</td>" +
    "<td class='vertificationmoveinmulti'>" +
    "<cfoutput query='serial'><input type='text' name='vertifidate_" + count + "' value='#verification_date#'>&nbsp;&nbsp;</cfoutput>" +
    "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
    "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
    "</td>" +
    "</tr>" +
    "</table>";
     
    <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td class='red' id='paddingformultitop'>" +
    "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
    "<select name='deptvendor_" + count + "'>" +
    "<option value='' selected>Make A Selection</option>" +
    "<cfoutput query='getDeptVendor'>" +
    "<option value='#pk_deptVendor#'<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>" +
    " </cfoutput>" +
    "</select>" +
    "</td>" +
    "</tr>" +
    "</table>";
     
    <!--- Adds Extra fields for RMA Data Only  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td id='paddingformultitop'>" +
    "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
    "</td>" +
    "<td class='rmanmoveinmulti'>" +
    "( You may enter up to 500 characters. )"+
    "<br/>" +
    "<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> " +
    "</td>" +
    "</tr>" +
    "</table>" +
    "<input type='hidden' name='serialcount' value='" + count + "'>";
     
    <!--- Adds Delete to every ticket  --->
    newdiv.innerHTML = newdiv.innerHTML +
    "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
    "<tr>" +
    "<td>" +
    "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
    "</td>" +
    "</td>" +
    "</tr>" +
    "</table><br>";
    
     document.getElementById(divName).appendChild(newdiv);
    
    } 
    </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.

    Code:
    <CFSET machineListLen = listLen(Form.serialcount)>
    <CFLOOP from="1" to="#machineListLen#" index="machineCount">
     <CFSET serialnum       = "Form.serialnum_" & machineCount>
     <CFSET modelno         = "Form.modelno_" & machineCount>
     <CFSET producttype     = "Form.producttype_" & machineCount>
     <CFSET softhardware    = "Form.softhardware_" & machineCount>
     <CFSET resolution      = "Form.resolution_" & machineCount>
     <CFSET resdate         = "Form.resdate_" & machineCount>
     <CFSET resvertified    = "Form.resvertified_" & machineCount>
     <CFSET vertifidate     = "Form.vertifidate_" & machineCount>
     <CFSET deptvendor      = "Form.deptvendor_" & machinecount>
     <CFSET hardwarefailure = "Form.hardwarefailure_" & machineCount>
     <CFSET rma             = "Form.rma_" & machineCount>
     <CFSET thedescription  = "Form.thedescription_" & machineCount>
    
    #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
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Rather than using JavaScript to show the information onload, use Coldfusion directly in the HTML inside the "dynamicInp ut" div using a loop (cfoutput or cfloop) to loop over the query. Convert the JavaScript innerHTML statements into normal HTML code.

    Comment

    • bonneylake
      Contributor
      • Aug 2008
      • 769

      #3
      Originally posted by acoder
      Rather than using JavaScript to show the information onload, use Coldfusion directly in the HTML inside the "dynamicInp ut" div using a loop (cfoutput or cfloop) to loop over the query. Convert the JavaScript innerHTML statements into normal HTML code.
      Hey Acoder,

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

      Thank you,
      Rach

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Almost. There's no need for any JavaScript here because you're calling it onload anyway. Convert all the JavaScript into Coldfusion instead so that the table/form appears whilst the page is loading and not after. To convert the JavaScript is not difficult. Take all the table and form code and put it directly in the div. The cfloop would be for each ticket, so there would be no repetition.

        Comment

        • bonneylake
          Contributor
          • Aug 2008
          • 769

          #5
          Originally posted by acoder
          Almost. There's no need for any JavaScript here because you're calling it onload anyway. Convert all the JavaScript into Coldfusion instead so that the table/form appears whilst the page is loading and not after. To convert the JavaScript is not difficult. Take all the table and form code and put it directly in the div. The cfloop would be for each ticket, so there would be no repetition.
          Hey Acoder,

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


          Code:
          <script type="text/javascript">
          
          <!---Allows us to show previous fields --->
          
          function showInput(divName){
          var dynamic = document.getElementById('dynamicInput');
          var thevalue = document.getElementById('theValue');
          var count = (document.getElementById('theValue').value -1)+ 2;
          thevalue.value = count;
          var newdiv = document.createElement('div');
          var divIdName = 'dynamic'+count+'Input';
          newdiv.setAttribute('id',divIdName);
           
          
          <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
          newdiv.innerHTML =
          
          "<table class='zpExpandedTable' id='modeltable'>" +
          "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
          "<tr>" +
          "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
          "</td>" +
          "<td>" +
           "<select name='modelno_" + count + "'>" +
           "<option value=''>Make A Selection</option>" +
          "<cfoutput query='models'>" + 
          "<option value='#model#'<cfif #model# is #model_no#>selected</cfif>>#model#</option>" + 
          "</cfoutput>" + 
           "</select>" +
           "</td>" +
           "<td>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
          "</td>" +
          "<td>" +
          "<select name='producttype_" + count + "'>" +
          "<option value='' selected>No Choice</option>" +
          "<cfoutput query='getProdType'>" + 
          "<option value='#pk_productType#'<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option>" + 
          "</cfoutput>" + 
          "</select>" +
          "</td>" +
          "<td class='red'>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
          "</td>" +
          "<td>" +
          "<select name='hardwarefailure_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='getHardwareFail'>" +
          "<option value='#pk_hardwareFailure#'<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>" +
          "</cfoutput>" +
          "</select>" +
          "</td>" +
          "</tr>" +
          "<table>";
           
          <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='modeltable'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Serial Number:&nbsp;&nbsp;" +
          "<cfoutput query="serial"><input type='text' name='serialnum_" + count + "' value='#pka_serialNo#' ></cfoutput>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
          "<select name='softhardware_" + count + "'>" +
          "<option value='' selected>No Choice</option>" +
          "<cfoutput query='getSoftHard'>" + 
          "<option value='#pk_softwareHardware#'<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>" + 
          "</cfoutput>" + 
          "</select>" +
          "</td>" +
          "</tr>" +
          "</table>";
          
          <!--- Adds Extra fields for Description ---> 
          newdiv.innerHTML = newdiv.innerHTML + 
          "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformutli'>" +
          "Description:&nbsp;&nbsp;" + 
          "</td>" +
          "<td class='descriptionmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br>" +
          "<cfoutput query="description"><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'>#description#</textarea></cfoutput>" + 
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Resolution  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformutli'>" +
          "Resolution:&nbsp;&nbsp;" +
          "</td>" +
          "<td class='resolutionmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br>" +
          "<cfoutput query='serial'><textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'>#resolution#</textarea></cfoutput>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
          "</td>" +
          "<td>" +
          "<cfoutput query='serial'><input type='text' name='resdate_" + count + "' value='#resolution_date#'>&nbsp;&nbsp;</cfoutput>" +
           
          "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
          "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
          "</td>" +
          "<td>" +
          "Resolution Verified as effective by:&nbsp;&nbsp;"  +
          "</td>" +
          "<td>" +
          "<select name='resvertified_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='gettech'>" +
          "<option value='#fname# #lname#'<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>" +
          " </cfoutput>" +
          "</select>" +
          "</td>" +
          "</tr>" +
          "</table>";
          
           
          <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
          "</td>" +
          "<td class='vertificationmoveinmulti'>" +
          "<cfoutput query='serial'><input type='text' name='vertifidate_" + count + "' value='#verification_date#'>&nbsp;&nbsp;</cfoutput>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
          "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td class='red' id='paddingformultitop'>" +
          "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
          "<select name='deptvendor_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='getDeptVendor'>" +
          "<option value='#pk_deptVendor#'<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>" +
          " </cfoutput>" +
          "</select>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for RMA Data Only  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
          "</td>" +
          "<td class='rmanmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br/>" +
          "<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> " +
          "</td>" +
          "</tr>" +
          "</table>" +
          "<input type='hidden' name='serialcount' value='" + count + "'>";
           
          <!--- Adds Delete to every ticket  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td>" +
          "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
          "</td>" +
          "</td>" +
          "</tr>" +
          "</table><br>";
          
           document.getElementById(divName).appendChild(newdiv);
          
          } 
          
          
          
          
          
           <!---Allows us to add serial information multiple times --->
          function addInput(divName){
          var dynamic = document.getElementById('dynamicInput');
          var thevalue = document.getElementById('theValue');
          var count = (document.getElementById('theValue').value -1)+ 2;
          thevalue.value = count;
          var newdiv = document.createElement('div');
          var divIdName = 'dynamic'+count+'Input';
          newdiv.setAttribute('id',divIdName);
           
          <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
          newdiv.innerHTML =
          "<table class='zpExpandedTable' id='modeltable'>" +
          "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
          "<tr>" +
          "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
          "</td>" +
          "<td>" +
           "<select name='modelno_" + count + "' >" +
           "<option value=''>Make A Selection</option>" +
          "<cfoutput query='models'>" + 
          "<option value='#model#'>#model#</option>" + 
          "</cfoutput>" + 
           "</select>" +
           "</td>" +
           "<td>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
          "</td>" +
          "<td>" +
          "<select name='producttype_" + count + "'>" +
          "<option value='' selected>No Choice</option>" +
          "<cfoutput query='getProdType'>" + 
          "<option value='#pk_productType#'>#pk_productType#</option>" + 
          "</cfoutput>" + 
          "</select>" +
          "</td>" +
          "<td class='red'>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
          "</td>" +
          "<td>" +
          "<select name='hardwarefailure_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='getHardwareFail'>" +
          "<option value='#pk_hardwareFailure#'>#pk_hardwareFailure#</option>" +
          "</cfoutput>" +
          "</select>" +
          "</td>" +
          "</tr>" +
          "<table>";
           
          <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='modeltable'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Serial Number:&nbsp;&nbsp;" +
          "<input type='text' name='serialnum_" + count + "'>" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
          "<select name='softhardware_" + count + "'>" +
          "<option value='' selected>No Choice</option>" +
          "<cfoutput query='getSoftHard'>" + 
          "<option value='#pk_softwareHardware#'>#pk_softwareHardware#</option>" + 
          "</cfoutput>" + 
          "</select>" +
          "</td>" +
          "</tr>" +
          "</table>";
          
          <!--- Adds Extra fields for Description  --->
          newdiv.innerHTML = newdiv.innerHTML + 
          "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformutli'>" +
          "Description:&nbsp;&nbsp;" + 
          "</td>" +
          "<td class='descriptionmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br>" +
          "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'></textarea>" + 
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Resolution  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformutli'>" +
          "Resolution:&nbsp;&nbsp;" +
          "</td>" +
          "<td class='resolutionmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br>" +
          "<textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'></textarea>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
          "</td>" +
          "<td>" +
          "<input type='text' name='resdate_" + count + "' value=''  >&nbsp;&nbsp;" +
           
          "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
          "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
          "</td>" +
          "<td>" +
          
          "Resolution Verified as effective by:&nbsp;&nbsp;"  +
          "</td>" +
          "<td>" +
          "<select name='resvertified_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='gettech'><option value='#fname# #lname#'>#fname# #lname#</option></cfoutput></select>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) and resolution vertified as effective by  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
          "</td>" +
          "<td class='vertificationmoveinmulti'>" +
          "<input type='text' name='vertifidate_" + count + "'>&nbsp;&nbsp;" +
          "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
          "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td class='red' id='paddingformultitop'>" +
          "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
          "<select name='deptvendor_" + count + "'>" +
          "<option value='' selected>Make A Selection</option>" +
          "<cfoutput query='getDeptVendor'>" +
          "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
          " </cfoutput>" +
          "</select>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          <!--- Adds Extra fields for RMA Data Only  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td id='paddingformultitop'>" +
          "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
          "</td>" +
          "<td class='rmanmoveinmulti'>" +
          "( You may enter up to 500 characters. )"+
          "<br/>" +
          "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "'></textarea> " +
          "</td>" +
          "</tr>" +
          "</table>" +
          "<input type='hidden' name='serialcount' value='" + count + "'>";
           
          <!--- Adds Delete to every ticket  --->
          newdiv.innerHTML = newdiv.innerHTML +
          "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
          "<tr>" +
          "<td>" +
          "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
          "</td>" +
          "</td>" +
          "</tr>" +
          "</table>";
           
          document.getElementById(divName).appendChild(newdiv);
          } 
           
           
          <!---Allows us to remove multiple fields --->
          function removeElement(divNum) {
            var d = document.getElementById('dynamicInput');
            var olddiv = document.getElementById(divNum);
            d.removeChild(olddiv);
          }
          
          </script>
          <body onload="showInput('dynamicInput');">
          <!--- Ticket Information 
                 This display the ticket Information--->
                 
                 
                 
                 
          <input type="hidden" value="0" id="theValue" />
               <div id="dynamicInput">
               <!--- All Ticket Information Appears Here--->
              <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
          
          
          <table class="zpExpandedTable" id="modeltable">
          <th class="sectiontitletick" colspan="7">Serial Information '+ count +' </th>
          <tr>
          <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
          </td>
          <td>
          <select name="modelno_' + count + '">
          <option value="">Make A Selection</option>
          <cfoutput query="models">
          <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
          </cfoutput> 
          </select>
          </td>
          <td>
          &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
          </td>
          <td>
          <select name="producttype_' + count + '">
          <option value="" selected>No Choice</option>
          <cfoutput query="getProdType">
          <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
          </cfoutput>
          </select>
          </td>
          <td class="red'">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
          </td>
          <td>
          <select name="hardwarefailure_' + count + '">
          <option value="" selected>Make A Selection</option>
          <cfoutput query="getHardwareFail">
          <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
          </cfoutput>
          </select>
          </td>
          </tr>
          <table>
           
          <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
          <table class="zpExpandedTable" id="modeltable">
          <tr>
          <td id="paddingformultitop">
          Serial Number:&nbsp;&nbsp;
          <cfoutput query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfoutput>
          &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
          <select name="softhardware_' + count + '">
          <option value="" selected>No Choice</option>
          <cfoutput query="getSoftHard">
          <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
          </cfoutput>
          </select>
          </td>
          </tr>
          </table>
          
          <!--- Adds Extra fields for Description ---> 
          
          <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
          <tr>
          <td id="paddingformutli">
          Description:&nbsp;&nbsp;
          </td>
          <td class="descriptionmoveinmulti">
          ( You may enter up to 500 characters. )
          <br>
          <cfoutput query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfoutput> 
          </td>
          </tr>
          </table>
           
          <!--- Adds Extra fields for Resolution  --->
          
          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
          <tr>
          <td id="paddingformutli">
          Resolution:&nbsp;&nbsp;
          </td>
          <td class="resolutionmoveinmulti">
          ( You may enter up to 500 characters. )
          <br>
          <cfoutput query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfoutput>
          </td>
          </tr>
          </table>
           
          <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
          
          <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
          <tr>
          <td id="paddingformultitop">
          Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
          </td>
          <td>
          <cfoutput query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfoutput>
           
          &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
          <input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>
          </td>
          <td>
          Resolution Verified as effective by:&nbsp;&nbsp;
          </td>
          <td>
          <select name="resvertified_' + count + '">
          <option value="" selected>Make A Selection</option>
          <cfoutput query="gettech">
          <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
          </cfoutput>
          </select>
          </td>
          </tr>
          </table>
          
           
          <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
          <tr>
          <td id="paddingformultitop">
          Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
          </td>
          <td class="vertificationmoveinmulti">
          <cfoutput query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfoutput>
          &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
          <input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>
          </td>
          </tr>
          </table>
           
          <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
          <tr>
          <td class="red" id="paddingformultitop">
          Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <select name="deptvendor_' + count + '">
          <option value="" selected>Make A Selection</option>
          <cfoutput query="getDeptVendor">
          <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
          </cfoutput>
          </select>
          </td>
          </tr>
          </table>
           
          <!--- Adds Extra fields for RMA Data Only  --->
          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
          <tr>
          <td id="paddingformultitop">
          RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
          </td>
          <td class="rmanmoveinmulti">
          ( You may enter up to 500 characters. )
          <br/>
          <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>
          </td>
          </tr>
          </table>
          <input type="hidden" name="serialcount" value="' + count + '">
           
          <!--- Adds Delete to every ticket  --->
          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
          <tr>
          <td>
          <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
          </td>
          </td>
          </tr>
          </table>
          
          
          
          
          
               </div>
               <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
          Thank you,
          Rach

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Yes, there's no need for the showInput function any more. For example, you can replace:
            Code:
            newdiv.innerHTML =
            "<table class='zpExpandedTable' id='modeltable'>" +
            "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
            "<tr>" +
            with
            Code:
            <div ...>
            <cfoutput query="...">
            <table class='zpExpandedTable' id='modeltable'>
            <th class='sectiontitletick' colspan='7'>Serial Information #count# </th>
            <tr>

            Comment

            • bonneylake
              Contributor
              • Aug 2008
              • 769

              #7
              Originally posted by acoder
              Yes, there's no need for the showInput function any more. For example, you can replace:
              Code:
              newdiv.innerHTML =
              "<table class='zpExpandedTable' id='modeltable'>" +
              "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
              "<tr>" +
              with
              Code:
              <div ...>
              <cfoutput query="...">
              <table class='zpExpandedTable' id='modeltable'>
              <th class='sectiontitletick' colspan='7'>Serial Information #count# </th>
              <tr>
              Hey Acoder,

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

              Code:
              <script type="text/javascript">
              
               <!---Allows us to add serial information multiple times --->
              function addInput(divName){
              var dynamic = document.getElementById('dynamicInput');
              var thevalue = document.getElementById('theValue');
              var count = (document.getElementById('theValue').value -1)+ 2;
              thevalue.value = count;
              var newdiv = document.createElement('div');
              var divIdName = 'dynamic'+count+'Input';
              newdiv.setAttribute('id',divIdName);
               
              <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
              newdiv.innerHTML =
              "<table class='zpExpandedTable' id='modeltable'>" +
              "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
              "<tr>" +
              "<td id='paddingformultitop'>Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>" +
              "</td>" +
              "<td>" +
               "<select name='modelno_" + count + "' >" +
               "<option value=''>Make A Selection</option>" +
              "<cfoutput query='models'>" + 
              "<option value='#model#'>#model#</option>" + 
              "</cfoutput>" + 
               "</select>" +
               "</td>" +
               "<td>" +
              "&nbsp;&nbsp;&nbsp;&nbsp;Product Type:"  +
              "</td>" +
              "<td>" +
              "<select name='producttype_" + count + "'>" +
              "<option value='' selected>No Choice</option>" +
              "<cfoutput query='getProdType'>" + 
              "<option value='#pk_productType#'>#pk_productType#</option>" + 
              "</cfoutput>" + 
              "</select>" +
              "</td>" +
              "<td class='red'>" +
              "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:" +
              "</td>" +
              "<td>" +
              "<select name='hardwarefailure_" + count + "'>" +
              "<option value='' selected>Make A Selection</option>" +
              "<cfoutput query='getHardwareFail'>" +
              "<option value='#pk_hardwareFailure#'>#pk_hardwareFailure#</option>" +
              "</cfoutput>" +
              "</select>" +
              "</td>" +
              "</tr>" +
              "<table>";
               
              <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='modeltable'>" +
              "<tr>" +
              "<td id='paddingformultitop'>" +
              "Serial Number:&nbsp;&nbsp;" +
              "<input type='text' name='serialnum_" + count + "'>" +
              "&nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;" +
              "<select name='softhardware_" + count + "'>" +
              "<option value='' selected>No Choice</option>" +
              "<cfoutput query='getSoftHard'>" + 
              "<option value='#pk_softwareHardware#'>#pk_softwareHardware#</option>" + 
              "</cfoutput>" + 
              "</select>" +
              "</td>" +
              "</tr>" +
              "</table>";
              
              <!--- Adds Extra fields for Description  --->
              newdiv.innerHTML = newdiv.innerHTML + 
              "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
              "<tr>" +
              "<td id='paddingformutli'>" +
              "Description:&nbsp;&nbsp;" + 
              "</td>" +
              "<td class='descriptionmoveinmulti'>" +
              "( You may enter up to 500 characters. )"+
              "<br>" +
              "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'></textarea>" + 
              "</td>" +
              "</tr>" +
              "</table>";
               
              <!--- Adds Extra fields for Resolution  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td id='paddingformutli'>" +
              "Resolution:&nbsp;&nbsp;" +
              "</td>" +
              "<td class='resolutionmoveinmulti'>" +
              "( You may enter up to 500 characters. )"+
              "<br>" +
              "<textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'></textarea>" +
              "</td>" +
              "</tr>" +
              "</table>";
               
              <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td id='paddingformultitop'>" +
              "Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
              "</td>" +
              "<td>" +
              "<input type='text' name='resdate_" + count + "' value=''  >&nbsp;&nbsp;" +
               
              "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
              "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
              "</td>" +
              "<td>" +
              
              "Resolution Verified as effective by:&nbsp;&nbsp;"  +
              "</td>" +
              "<td>" +
              "<select name='resvertified_" + count + "'>" +
              "<option value='' selected>Make A Selection</option>" +
              "<cfoutput query='gettech'><option value='#fname# #lname#'>#fname# #lname#</option></cfoutput></select>" +
              "</td>" +
              "</tr>" +
              "</table>";
               
              <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) and resolution vertified as effective by  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td id='paddingformultitop'>" +
              "Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;" +
              "</td>" +
              "<td class='vertificationmoveinmulti'>" +
              "<input type='text' name='vertifidate_" + count + "'>&nbsp;&nbsp;" +
              "&nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;" +
              "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
              "</td>" +
              "</tr>" +
              "</table>";
               
              <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td class='red' id='paddingformultitop'>" +
              "Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  +
              "<select name='deptvendor_" + count + "'>" +
              "<option value='' selected>Make A Selection</option>" +
              "<cfoutput query='getDeptVendor'>" +
              "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
              " </cfoutput>" +
              "</select>" +
              "</td>" +
              "</tr>" +
              "</table>";
               
              <!--- Adds Extra fields for RMA Data Only  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td id='paddingformultitop'>" +
              "RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;" +
              "</td>" +
              "<td class='rmanmoveinmulti'>" +
              "( You may enter up to 500 characters. )"+
              "<br/>" +
              "<textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "'></textarea> " +
              "</td>" +
              "</tr>" +
              "</table>" +
              "<input type='hidden' name='serialcount' value='" + count + "'>";
               
              <!--- Adds Delete to every ticket  --->
              newdiv.innerHTML = newdiv.innerHTML +
              "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
              "<tr>" +
              "<td>" +
              "<input type='button' class='removeticket' value='Remove Serial &quot;"+count +"&quot;' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
              "</td>" +
              "</td>" +
              "</tr>" +
              "</table>";
               
              document.getElementById(divName).appendChild(newdiv);
              } </script>
              
              <body onload="dynamicInput">
              <input type="hidden" value="0" id="theValue" />
                   <div id="dynamicInput">
                   <!--- All Ticket Information Appears Here--->
                  <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure  --->
              
              <cfoutput query="serial">
              <table class="zpExpandedTable" id="modeltable">
              <th class="sectiontitletick" colspan="7">Serial Information [B]'#count#'[/B] </th>
              <tr></cfoutput>
              <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
              </td>
              <td>
              <select name="modelno_' + count + '">
              <option value="">Make A Selection</option>
              <cfoutput query="models">
              <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
              </cfoutput> 
              </select>
              </td>
              <td>
              &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
              </td>
              <td>
              <select name="producttype_' + count + '">
              <option value="" selected>No Choice</option>
              <cfoutput query="getProdType">
              <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
              </cfoutput>
              </select>
              </td>
              <td class="red'">
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
              </td>
              <td>
              <select name="hardwarefailure_' + count + '">
              <option value="" selected>Make A Selection</option>
              <cfoutput query="getHardwareFail">
              <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
              </cfoutput>
              </select>
              </td>
              </tr>
              <table>
               
              <!--- Adds Extra fields for Serial Number and Software/Hardware  --->
              <table class="zpExpandedTable" id="modeltable">
              <tr>
              <td id="paddingformultitop">
              Serial Number:&nbsp;&nbsp;
              <cfoutput query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfoutput>
              &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
              <select name="softhardware_' + count + '">
              <option value="" selected>No Choice</option>
              <cfoutput query="getSoftHard">
              <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
              </cfoutput>
              </select>
              </td>
              </tr>
              </table>
              
              <!--- Adds Extra fields for Description ---> 
              
              <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
              <tr>
              <td id="paddingformutli">
              Description:&nbsp;&nbsp;
              </td>
              <td class="descriptionmoveinmulti">
              ( You may enter up to 500 characters. )
              <br>
              <cfoutput query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfoutput> 
              </td>
              </tr>
              </table>
               
              <!--- Adds Extra fields for Resolution  --->
              
              <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
              <tr>
              <td id="paddingformutli">
              Resolution:&nbsp;&nbsp;
              </td>
              <td class="resolutionmoveinmulti">
              ( You may enter up to 500 characters. )
              <br>
              <cfoutput query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfoutput>
              </td>
              </tr>
              </table>
               
              <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
              
              <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
              <tr>
              <td id="paddingformultitop">
              Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
              </td>
              <td>
              <cfoutput query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfoutput>
               
              &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
              [B]<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>[/B]
              
              </td>
              <td>
              Resolution Verified as effective by:&nbsp;&nbsp;
              </td>
              <td>
              <select name="resvertified_' + count + '">
              <option value="" selected>Make A Selection</option>
              <cfoutput query="gettech">
              <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
              </cfoutput>
              </select>
              </td>
              </tr>
              </table>
              <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date)   --->
              <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
              <tr>
              <td id="paddingformultitop">
              Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
              </td>
              <td class="vertificationmoveinmulti">
              <cfoutput query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfoutput>
              &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
              [B]<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>[/B]
              </td>
              </tr>
              </table>
               
              <!--- Adds Extra fields for Dept/Vendor Responsibility  --->
              <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
              <tr>
              <td class="red" id="paddingformultitop">
              Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <select name="deptvendor_' + count + '">
              <option value="" selected>Make A Selection</option>
              <cfoutput query="getDeptVendor">
              <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
              </cfoutput>
              </select>
              </td>
              </tr>
              </table>
               
              <!--- Adds Extra fields for RMA Data Only  --->
              <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
              <tr>
              <td id="paddingformultitop">
              RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
              </td>
              <td class="rmanmoveinmulti">
              ( You may enter up to 500 characters. )
              <br/>
              <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>
              </td>
              </tr>
              </table>
              <input type="hidden" name="serialcount" value="' + count + '">
               
              <!--- Adds Delete to every ticket  --->
              <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
              <tr>
              <td>
              <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
              </td>
              </td>
              </tr>
              </table>
              
              
              
              
              
                   </div>
                   <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
              Thank you again for all the help :),
              Rach

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                That was only an example. #count# you'd have to set in your Coldfusion, e.g. on each loop iteration increase #count# by 1.

                Comment

                • bonneylake
                  Contributor
                  • Aug 2008
                  • 769

                  #9
                  Originally posted by acoder
                  That was only an example. #count# you'd have to set in your Coldfusion, e.g. on each loop iteration increase #count# by 1.
                  Hey Acoder,

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

                  Thank you :),
                  Rach

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    You could use cfloop instead of cfoutput for the inner queries

                    Comment

                    • bonneylake
                      Contributor
                      • Aug 2008
                      • 769

                      #11
                      Originally posted by acoder
                      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?


                      Code:
                      <cfquery name="serial" datasource="CustomerSupport">
                      		SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
                               verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
                      </cfquery>
                      
                      <cfloop query="serial">
                      <cfset model_no = #model_no#>
                      <cfset product_type = #product_type#>
                      <cfset type_hardware_failure = #type_hardware_failure#>
                      <cfset software_hardware = #software_hardware#>
                      <cfset resolution_verified_by = #resolution_verified_by#>
                      <cfset dept_responsibility = #dept_responsibility#>
                      </cfloop>
                      
                      <!--- Ticket Information 
                             This display the ticket Information--->
                          
                      <input type="hidden" value="0" id="theValue" />
                           <div id="dynamicInput">
                           <!--- All Ticket Information Appears Here--->
                          <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
                      
                      
                      <table class="zpExpandedTable" id="modeltable"> 
                      <th class="sectiontitletick" colspan="7">Serial Information <!---#count#---> </th>
                      <tr>
                      <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
                      </td>
                      <td>
                      <select name="modelno_' + count + '">
                      <option value="">Make A Selection</option>
                      <cfloop query="models">
                      <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
                      </cfloop> 
                      </select>
                      </td>
                      <td>
                      &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
                      </td>
                      <td>
                      <select name="producttype_' + count + '">
                      <option value="" selected>No Choice</option>
                      <cfloop query="getProdType">
                      <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
                      </cfloop>
                      </select>
                      </td>
                      <td class="red'">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
                      </td>
                      <td>
                      <select name="hardwarefailure_' + count + '">
                      <option value="" selected>Make A Selection</option>
                      <cfloop query="getHardwareFail">
                      <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
                      </cfloop>
                      </select>
                      </td>
                      </tr>
                      <table>
                       
                      <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
                      <table class="zpExpandedTable" id="modeltable">
                      <tr>
                      <td id="paddingformultitop">
                      Serial Number:&nbsp;&nbsp;
                      <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
                      &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
                      <select name="softhardware_' + count + '">
                      <option value="" selected>No Choice</option>
                      <cfloop query="getSoftHard">
                      <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
                      </cfloop>
                      </select>
                      </td>
                      </tr>
                      </table>
                      
                      <!--- Shows what was previously entered for Description ---> 
                      
                      <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
                      <tr>
                      <td id="paddingformutli">
                      Description:&nbsp;&nbsp;
                      </td>
                      <td class="descriptionmoveinmulti">
                      ( You may enter up to 500 characters. )
                      <br>
                      <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
                      </td>
                      </tr>
                      </table>
                       
                      <!---Shows what was previously entered for Resolution  --->
                      
                      <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                      <tr>
                      <td id="paddingformutli">
                      Resolution:&nbsp;&nbsp;
                      </td>
                      <td class="resolutionmoveinmulti">
                      ( You may enter up to 500 characters. )
                      <br>
                      <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
                      </td>
                      </tr>
                      </table>
                       
                      <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
                      
                      <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
                      <tr>
                      <td id="paddingformultitop">
                      Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                      </td>
                      <td>
                      <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
                       
                      &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                      <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
                      
                      </td>
                      <td>
                      Resolution Verified as effective by:&nbsp;&nbsp;
                      </td>
                      <td>
                      <select name="resvertified_' + count + '">
                      <option value="" selected>Make A Selection</option>
                      <cfloop query="gettech">
                      <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
                      </cfloop>
                      </select>
                      </td>
                      </tr>
                      </table>
                      <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
                      <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                      <tr>
                      <td id="paddingformultitop">
                      Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                      </td>
                      <td class="vertificationmoveinmulti">
                      <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
                      &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                      <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
                      </td>
                      </tr>
                      </table>
                       
                      <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
                      <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                      <tr>
                      <td class="red" id="paddingformultitop">
                      Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <select name="deptvendor_' + count + '">
                      <option value="" selected>Make A Selection</option>
                      <cfloop query="getDeptVendor">
                      <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
                      </cfloop>
                      </select>
                      </td>
                      </tr>
                      </table>
                       
                      <!--- Shows what was previously entered for RMA Data Only  --->
                      <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                      <tr>
                      <td id="paddingformultitop">
                      RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
                      </td>
                      <td class="rmanmoveinmulti">
                      ( You may enter up to 500 characters. )
                      <br/>
                      <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>
                      </td>
                      </tr>
                      </table>
                      <input type="hidden" name="serialcount" value="' + count + '">
                       
                      <!--- Adds Delete to every ticket  --->
                      <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                      <tr>
                      <td>
                      <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
                      </td>
                      </td>
                      </tr>
                      </table>
                      
                      
                      
                      
                      
                           </div>
                           <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
                      Thank you,
                      Rach

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        The outer loop should be cfoutput of course.

                        Comment

                        • bonneylake
                          Contributor
                          • Aug 2008
                          • 769

                          #13
                          Originally posted by acoder
                          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

                          Code:
                          <cfoutput>
                          <table class="zpExpandedTable" id="modeltable"> 
                          <th class="sectiontitletick" colspan="7">Serial Information <!---#count#---> </th>
                          <tr>
                          <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
                          </td>
                          <td>
                          <select name="modelno_' + count + '">
                          <option value="">Make A Selection</option>
                          <cfloop query="models">
                          <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
                          </cfloop> 
                          </select>
                          </td>
                          <td>
                          &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
                          </td>
                          <td>
                          <select name="producttype_' + count + '">
                          <option value="" selected>No Choice</option>
                          <cfloop query="getProdType">
                          <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
                          </cfloop>
                          </select>
                          </td>
                          <td class="red'">
                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
                          </td>
                          <td>
                          <select name="hardwarefailure_' + count + '">
                          <option value="" selected>Make A Selection</option>
                          <cfloop query="getHardwareFail">
                          <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
                          </cfloop>
                          </select>
                          </td>
                          </tr>
                          <table>
                           
                          <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
                          <table class="zpExpandedTable" id="modeltable">
                          <tr>
                          <td id="paddingformultitop">
                          Serial Number:&nbsp;&nbsp;
                          <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
                          &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
                          <select name="softhardware_' + count + '">
                          <option value="" selected>No Choice</option>
                          <cfloop query="getSoftHard">
                          <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
                          </cfloop>
                          </select>
                          </td>
                          </tr>
                          </table>
                          
                          <!--- Shows what was previously entered for Description ---> 
                          
                          <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
                          <tr>
                          <td id="paddingformutli">
                          Description:&nbsp;&nbsp;
                          </td>
                          <td class="descriptionmoveinmulti">
                          ( You may enter up to 500 characters. )
                          <br>
                          <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
                          </td>
                          </tr>
                          </table>
                           
                          <!---Shows what was previously entered for Resolution  --->
                          
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td id="paddingformutli">
                          Resolution:&nbsp;&nbsp;
                          </td>
                          <td class="resolutionmoveinmulti">
                          ( You may enter up to 500 characters. )
                          <br>
                          <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
                          </td>
                          </tr>
                          </table>
                           
                          <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
                          
                          <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
                          <tr>
                          <td id="paddingformultitop">
                          Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                          </td>
                          <td>
                          <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
                           
                          &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                          <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
                          
                          </td>
                          <td>
                          Resolution Verified as effective by:&nbsp;&nbsp;
                          </td>
                          <td>
                          <select name="resvertified_' + count + '">
                          <option value="" selected>Make A Selection</option>
                          <cfloop query="gettech">
                          <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
                          </cfloop>
                          </select>
                          </td>
                          </tr>
                          </table>
                          <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td id="paddingformultitop">
                          Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                          </td>
                          <td class="vertificationmoveinmulti">
                          <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
                          &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                          <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
                          </td>
                          </tr>
                          </table>
                           
                          <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td class="red" id="paddingformultitop">
                          Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <select name="deptvendor_' + count + '">
                          <option value="" selected>Make A Selection</option>
                          <cfloop query="getDeptVendor">
                          <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
                          </cfloop>
                          </select>
                          </td>
                          </tr>
                          </table>
                           
                          <!--- Shows what was previously entered for RMA Data Only  --->
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td id="paddingformultitop">
                          RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
                          </td>
                          <td class="rmanmoveinmulti">
                          ( You may enter up to 500 characters. )
                          <br/>
                          <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>
                          </td>
                          </tr>
                          </table>
                          <input type="hidden" name="serialcount" value="' + count + '">
                           
                          <!--- Adds Delete to every ticket  --->
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td>
                          <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
                          </td>
                          </td>
                          </tr>
                          </table>
                          </cfoutput>
                          Thank you,
                          Rach

                          Comment

                          • bonneylake
                            Contributor
                            • Aug 2008
                            • 769

                            #14
                            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

                            Code:
                            <cfoutput query="serial">
                            <table class="zpExpandedTable" id="modeltable"> 
                            <th class="sectiontitletick" colspan="7">Serial Information <!---#count# ---></th>
                            <tr>
                            <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            </td>
                            <td>
                            <select name="modelno_' + count + '">
                            <option value="">Make A Selection</option>
                            <cfloop query="models">
                            <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
                            </cfloop> 
                            </select>
                            </td>
                            <td>
                            &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
                            </td>
                            <td>
                            <select name="producttype_' + count + '">
                            <option value="" selected>No Choice</option>
                            <cfloop query="getProdType">
                            <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
                            </cfloop>
                            </select>
                            </td>
                            <td class="red'">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
                            </td>
                            <td>
                            <select name="hardwarefailure_' + count + '">
                            <option value="" selected>Make A Selection</option>
                            <cfloop query="getHardwareFail">
                            <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
                            </cfloop>
                            </select>
                            </td>
                            </tr>
                            <table>
                             
                            <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
                            <table class="zpExpandedTable" id="modeltable">
                            <tr>
                            <td id="paddingformultitop">
                            Serial Number:&nbsp;&nbsp;
                            <cfloop query="serial"><input type="text" name="serialnum_' + count + '" value="#pka_serialNo#"></cfloop>
                            &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
                            <select name="softhardware_' + count + '">
                            <option value="" selected>No Choice</option>
                            <cfloop query="getSoftHard">
                            <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
                            </cfloop>
                            </select>
                            </td>
                            </tr>
                            </table>
                            
                            <!--- Shows what was previously entered for Description ---> 
                            
                            <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
                            <tr>
                            <td id="paddingformutli">
                            Description:&nbsp;&nbsp;
                            </td>
                            <td class="descriptionmoveinmulti">
                            ( You may enter up to 500 characters. )
                            <br>
                            <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_' + count + '">#description#</textarea></cfloop> 
                            </td>
                            </tr>
                            </table>
                             
                            <!---Shows what was previously entered for Resolution  --->
                            
                            <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                            <tr>
                            <td id="paddingformutli">
                            Resolution:&nbsp;&nbsp;
                            </td>
                            <td class="resolutionmoveinmulti">
                            ( You may enter up to 500 characters. )
                            <br>
                            <cfloop query="serial"><textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_' + count + '">#resolution#</textarea></cfloop>
                            </td>
                            </tr>
                            </table>
                             
                            <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
                            
                            <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
                            <tr>
                            <td id="paddingformultitop">
                            Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                            </td>
                            <td>
                            <cfloop query="serial"><input type="text" name="resdate_' + count + '" value="#resolution_date#">&nbsp;&nbsp;</cfloop>
                             
                            &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                            <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
                            
                            </td>
                            <td>
                            Resolution Verified as effective by:&nbsp;&nbsp;
                            </td>
                            <td>
                            <select name="resvertified_' + count + '">
                            <option value="" selected>Make A Selection</option>
                            <cfloop query="gettech">
                            <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
                            </cfloop>
                            </select>
                            </td>
                            </tr>
                            </table>
                            <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
                            <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                            <tr>
                            <td id="paddingformultitop">
                            Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
                            </td>
                            <td class="vertificationmoveinmulti">
                            <cfloop query="serial"><input type="text" name="vertifidate_' + count + '" value="#verification_date#">&nbsp;&nbsp;</cfloop>
                            &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
                            <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
                            </td>
                            </tr>
                            </table>
                             
                            <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
                            <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                            <tr>
                            <td class="red" id="paddingformultitop">
                            Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <select name="deptvendor_' + count + '">
                            <option value="" selected>Make A Selection</option>
                            <cfloop query="getDeptVendor">
                            <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
                            </cfloop>
                            </select>
                            </td>
                            </tr>
                            </table>
                             
                            <!--- Shows what was previously entered for RMA Data Only  --->
                            <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                            <tr>
                            <td id="paddingformultitop">
                            RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td class="rmanmoveinmulti">
                            ( You may enter up to 500 characters. )
                            <br/>
                            <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>
                            </td>
                            </tr>
                            </table>
                            <input type="hidden" name="serialcount" value="' + count + '">
                             
                            <!--- Adds Delete to every ticket  --->
                            <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                            <tr>
                            <td>
                            <input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\"></a>
                            </td>
                            </td>
                            </tr>
                            </table>
                            </cfoutput>
                            Thank you,
                            Rach[/QUOTE]

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #15
                              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:
                              Code:
                              <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.

                              Comment

                              Working...