displaying previously entered multiple fields

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

    Originally posted by acoder
    This would be when there's no parts obviously. Check what the value of part2count1 is. It should be empty when there are no parts.
    Hey Acoder,

    well my thinking cap was not on an it is working how its suppose to. However, i ran into another problem with it :(. The user has to be able to add parts to some serials an not add parts to other serials, is this possible?

    Thank you,
    Rach

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      You mean allow for no parts to be added to any serial or even all serials? Yes, that should be possible.

      Comment

      • bonneylake
        Contributor
        • Aug 2008
        • 769

        Originally posted by acoder
        You mean allow for no parts to be added to any serial or even all serials? Yes, that should be possible.
        Hey Acoder,

        thats not quite what i mean. Right now i tested one serial with a part an another serial without a part. An i got an error with that (same one i been having). However, if every serial has a part and or every serial does not have a part it works right.So basically wondering if we can make it where it will still submit if one serial has a part an another serial does not have a part?

        Thank you,
        Rach

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          Yes, that should be possible. It should be working with the current code, but something's probably missing. When you have one serial with one part and one serial with no parts, check the values of part2count1 and part2count2.

          Comment

          • bonneylake
            Contributor
            • Aug 2008
            • 769

            Originally posted by acoder
            Yes, that should be possible. It should be working with the current code, but something's probably missing. When you have one serial with one part and one serial with no parts, check the values of part2count1 and part2count2.
            Hey Acoder,

            Ok i need to stop working on so many things at the same time. I figured out the problem an IT IS working correctly! i ended up changing one thing i didn't need to change. But THANK YOU THANK YOU!!!! However, i am having another problem that i was hoping you could explain (an it has to do with displaying previously submitted information). I figured out how to do the insert update stored procedure. An updating is working beautifully, but the inserting only does when you do it a certain way. But here is the trouble i am having.

            1) if i go back to view a serial or part. an let say i have 1 serial an i edited to change one field. Anyway when i go back to view it again (with the new changes) instead of it showing the one serial with the change it shows the one serial with the change an then adds another serial (but yet the another serial does not appear in the table i am inserting into.

            2)an also if i add a serial/part it will not be inserted into the table. Unless i change the serial name of a previously inserted serial then it will insert. But if i use javascript to add another it will not insert.

            but if you could explain those 2 that would be awesome. Which i am sorry i have made this thread so long. This is just a confusing one.

            Thank you,
            Rach

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              So you're saying this all works fine if you don't update, but once you update a serial or part field, you start to have these problems? Show the update code.

              Comment

              • bonneylake
                Contributor
                • Aug 2008
                • 769

                Originally posted by acoder
                So you're saying this all works fine if you don't update, but once you update a serial or part field, you start to have these problems? Show the update code.
                Hey Acoder,

                Yes i have the problem when i update previously submitted fields. But i also have the problem where if i try to add new serials and parts it will not insert it into the table, it will update old ones. But it will not insert new ones unless i take a old submitted serial and clear it out an put the new information in it.

                But here is what i have for the update

                here is the javascript for both serial and parts
                Code:
                <!---Allows us to add serial information multiple times --->
                <script type="text/javascript">
                <!---Allows us to add multiple fields --->
                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 getparts = document.createElement('div');
                var divIdName = 'dynamic'+count+'Input';
                var partc = 'partscount'+count;
                var part2c = 'part2count'+count;
                
                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 id='hardwarefailure' 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 1000 characters. )"+
                "<br>" +
                "<textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(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 1500 characters. )"+
                "<br>" +
                "<textarea maxlength='1500' onkeyup='return resolutionmaxlength(this)' onkeydown='return resolutionmaxlength(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 + "' id='deptvendor'>" +
                "<option value='' selected>Make A Selection</option>" +
                "<cfoutput query='getDeptVendor'>" +
                "<option value='#pk_deptVendor#'>#pk_deptVendor#</option>" +
                " </cfoutput>" +
                "</select>" +
                "</td>" +
                "</tr>" +
                "</table>" +
                "<input type='hidden' name='"+partc+"' id='"+partc+"' value='0'>" +
                "<input type='hidden' name='"+part2c+"' id='"+part2c+"' value=''>" +
                "<input type='hidden' name='serialcount' id='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>" +
                "</tr>" +
                "<tr>" +
                "<td>" + 
                "<input type='button' class='addticket' value='Add Parts' onclick=\"addpartInput(\'"+divIdName+"\')\">" +
                "</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>
                
                
                
                
                
                <!---Allows us to add PARTS information multiple times--->
                <script type="text/javascript">
                <!---Adds multiple fields for parts --->
                function addpartInput(partName){
                var parts = document.getElementById(partName);
                
                
                var getparts = document.getElementById('div');
                var serialno = partName.replace("dynamic","").replace("Input","");
                var avalue = document.getElementById("partscount"+serialno);
                var count = parseInt(avalue.value) + 1;
                avalue.value = count;
                var partslist = document.getElementById("part2count"+serialno);
                partslist.value += count + ",";
                var partdiv = document.createElement('div');
                var partIdName = 'part' + count + 'Name' + serialno;
                
                partdiv.setAttribute('id',partIdName);
                 
                <!--- Adds Extra fields for parts table  --->
                partdiv.innerHTML =
                "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0' >" +
                "<th class='sectiontitle' colspan='7'>Parts Information "+ count +" Serial Information "+serialno+"</th>" +
                "<tr>" +
                "<td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;" +
                "<input type='text' name='hcpn_" + count + "_"+serialno+"' style='margin:0px'></td>" +
                "<td>" +
                "Parts been returned* " +
                "<input type='checkbox' name='partsreturn_" + count + "_"+serialno+"' value='1'>" +
                "</td>" +
                "<td>" +
                "<td class='indent'>Defective<input type='checkbox' name='defective_" + count +"_"+serialno+"' value='1'>" +
                "</td>" +
                "</td>" +
                "</tr>" +
                "</table>";
                
                
                <!--- Adds Extra fields for RMA Data Only  --->
                partdiv.innerHTML = partdiv.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 1000 characters. )"+
                "<br/>" +
                "<textarea maxlength='1000' onkeyup='return rmamaxlength(this)' onkeydown='return rmamaxlength(this)' rows='4' cols='60' name='rma_" + count + "_"+serialno+"'></textarea> " +
                "</td>" +
                "</tr>" +
                "</table>";
                
                 
                <!--- Adds Delete to every ticket  --->
                partdiv.innerHTML = partdiv.innerHTML +
                "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
                "<tr>" +
                "<td>" +
                "<input type='button' class='removeticket' value='Remove Parts &quot;"+count +"&quot;' onclick=\"removetheElement('"+partIdName+"',"+serialno+","+count+")\"></a>" +
                "</td>" +
                "</td>" +
                "</tr>" +
                "</table>";
                 
                document.getElementById(partName).appendChild(partdiv);
                } 
                 
                <!---Allows us to remove multiple fields--->
                function removetheElement(divNum, serialno, partnum) {
                  var partslist = document.getElementById("part2count"+serialno);
                  partslist.value = partslist.value.replace(partnum+',',"");
                  var olddiv = document.getElementById(divNum);
                 olddiv.parentNode.removeChild(olddiv);
                }
                
                </script>

                an here is the html where the previously submitted fields appear

                Code:
                <!--- 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  --->
                <cfset count = 0>
                <!---<cfif serial.recordcount is 0>--->
                <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#>
                <cfset count = count + 1>
                <div id="dynamic#count#Input"> 
                <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;
                <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
                &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">
                #description#
                ( You may enter up to 1000 characters. )
                <br>
                <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
                </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 1500 characters. )
                <br>
                <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
                </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>
                <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&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>
                <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">
                <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&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>
                 
                <!--- 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>
                
                <input type="hidden" name="serialcount" id="serialcount" value="#count#">
                <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">
                <input type="hidden" name="part2count#count#" id="part2count#count#" value="">
                <!--- Adds Delete to every ticket  --->
                <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                <tr>
                <td>
                <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('dynamic#count#Input')">
                </td>
                </tr>
                <tr>
                <td>
                <input type="button" class="addticket" value="Add Parts" onclick=
                "addpartInput('dynamic#count#Input')">
                </td>
                </tr>
                </table>
                
                
                <!---Shows what was previously entered into parts table--->
                <!---dbtype="query"--->
                <cfquery name="getparts" dbtype="query" >
                SELECT *
                FROM parts
                WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
                cfsqltype="cf_sql_char" maxLength="20">
                </cfquery>
                <cfset count1 = 0>
                <!---<cfif serial.recordcount is 0>--->
                <cfloop query="getparts">
                <cfset count1 = count1 + 1>
                <div id="part#count1#Name#count#">
                <!---THIS IS THE PARTS SECTION--->
                <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
                <tr>
                <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
                <td>
                Parts been returned*
                <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
                </td>
                <td>
                <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
                </td>
                </tr>
                </table>
                <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
                
                
                <!--- 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 1000 characters. )
                <br/>
                <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea>
                </td>
                </tr>
                </table>
                
                
                <!--- Adds Delete to every ticket  --->
                <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                <tr>
                <td>
                <input type="button" class="removeticket" value="Remove Parts #count1#" 
                onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
                </td>
                </td>
                </tr>
                </table>
                </div>
                </cfloop>
                </div> 
                </cfoutput>
                <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
                
                <!---
                <!---If have any blanks in serial table it will make field appear--->
                <cfoutput query="serial">
                <cfset model_no = #model_no#>
                <cfset product_type = #product_type#>
                <cfset type_hardware_failure = #type_hardware_failure#>
                <cfset pka_serialNo = #pka_serialNo#>
                <cfset software_hardware = #software_hardware#>
                <cfset description = #description#>
                <cfset resolution = #resolution#>
                <cfset resolution_date = #resolution_date#>
                <cfset resolution_verified_by = #resolution_verified_by#>
                <cfset verification_date = #verification_date#>
                <cfset dept_responsibility = #dept_responsibility#>
                </cfoutput>
                <cfif serial.recordcount is 0>
                <cfset model_no = "">
                <cfset product_type = "">
                <cfset type_hardware_failure = "">
                <cfset pka_serialNo = "">
                <cfset software_hardware = "">
                <cfset description = "">
                <cfset resolution = "">
                <cfset resolution_date = "">
                <cfset resolution_verified_by = "">
                <cfset verification_date = "">
                <cfset dept_responsibility = "">
                <cfinclude template="serialdisplay.cfm">
                </cfif>
                
                <!---Parts Information, display parts if have or don't have a value--->
                <cfoutput query="parts">
                <cfset hc_partNo = #hc_partNo#>
                <cfset part_returned = #part_returned#>
                <cfset defective = #defective#>
                <cfset rma_number = #rma_number#>
                <cfinclude template="partsdisplay.cfm">
                </cfoutput>
                <cfif parts.recordcount is 0>
                <cfset hc_partNo = "">
                <cfset part_returned = "">
                <cfset defective = "">
                <cfset rma_number = "">
                <cfinclude template="partsdisplay.cfm">
                </cfif>
                --->
                </div>
                     <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
                right now i have the serialdisplay.c fm and partsdisplay.cf m in comments because its causeing me problems as well, but its suppose to display fields if no one entered a value for it. which if you need the information for both of those let me know.

                Thank you,
                Rach

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  Don't forget that you will need to update the code for the recent change, i.e. when displaying previously entered fields, the part numbers need to be up to date. So on line 167 where part2count#coun t# is set, the value should not be "". It should be filled with a list of the parts - 1 to the #count# value.

                  Comment

                  • bonneylake
                    Contributor
                    • Aug 2008
                    • 769

                    Originally posted by acoder
                    Don't forget that you will need to update the code for the recent change, i.e. when displaying previously entered fields, the part numbers need to be up to date. So on line 167 where part2count#coun t# is set, the value should not be "". It should be filled with a list of the parts - 1 to the #count# value.
                    Hey Acoder,

                    alrighty i changed that line to

                    Code:
                    <input type="hidden" name="part2count#count#" id="part2count#count#" value="#count#">
                    whats next? because i am still having the problem that once i go an edit a field and submit it an go to view the results again instead of just showing the one i change it ends up showing it multiple times. An i have checked the tables for both serial and parts an its not repeating the serial or parts. Any ideas?

                    Thank you,
                    Rach

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      The change that you've made wouldn't be enough because if, for example, you had three parts, it should be "1,2,3,", so you need a cfloop to construct the list.

                      Can you post the update field page code containing the form which you use to update/edit fields and the update serial/parts page including the query(ies).

                      Comment

                      • bonneylake
                        Contributor
                        • Aug 2008
                        • 769

                        Originally posted by acoder
                        The change that you've made wouldn't be enough because if, for example, you had three parts, it should be "1,2,3,", so you need a cfloop to construct the list.

                        Can you post the update field page code containing the form which you use to update/edit fields and the update serial/parts page including the query(ies).
                        Hey Acoder,

                        Here is the queries i am using

                        Code:
                        <!---Shows what was previously entered into serial and description table--->
                        <cfquery name="serial" datasource="CustomerSupport">
                        		SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,
                               resolution,resolution_date,verification_date,type_hardware_failure,
                                dept_responsibility,resolution_verified_by,fk_serialNo,fk_ticketNo,description
                                FROM dbo.tbl_CS_serial
                                LEFT JOIN dbo.tbl_CS_notes_descr
                                ON dbo.tbl_CS_serial.pkb_fk_ticketNo=dbo.tbl_CS_notes_descr.fk_ticketNo and
                                dbo.tbl_CS_serial.pka_serialNo=dbo.tbl_CS_notes_descr.fk_serialNo
                                WHERE pkb_fk_ticketNo = #URL.pk_ticketID# and fk_ticketNo = #URL.pk_ticketID#
                                ORDER BY pkb_fk_ticketNo
                        </cfquery>
                        
                        <!---Shows what was previously entered into parts table--->
                        <cfquery name="parts" datasource="CustomerSupport">
                               SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,ltrim(rtrim(part_returned)) as        part_returned,rma_number,defective
                                 FROM dbo.tbl_CS_parts
                                 WHERE fk_ticketNo = #URL.pk_ticketID#
                        </cfquery>
                        and here is what i am using to update/edit

                        Code:
                        <form action="userformedit.cfm" id="userForm"  name="userForm" method="POST" enctype="multipart/form-data" onclick="multipleSelectOnSubmit();">
                        
                        <!--- 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  --->
                        <cfset count = 0>
                        <!---<cfif serial.recordcount is 0>--->
                        <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#>
                        <cfset count = count + 1>
                        <div id="dynamic#count#Input"> 
                        <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;
                        <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
                        &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">
                        #description#
                        ( You may enter up to 1000 characters. )
                        <br>
                        <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea>
                        </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 1500 characters. )
                        <br>
                        <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
                        </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>
                        <input type="text" name="resdate_#count#" value="#DateFormat(resolution_date,'mm/dd/yyyy')#">&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>
                        <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">
                        <input type="text" name="vertifidate_#count#" value="#DateFormat(verification_date,'mm/dd/yyyy')#">&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>
                         
                        <!--- 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>
                        
                        <input type="hidden" name="serialcount" id="serialcount" value="#count#">
                        <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">
                        <input type="hidden" name="part2count#count#" id="part2count#count#" 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 #count#" onclick="removeElement('dynamic#count#Input')">
                        </td>
                        </tr>
                        <tr>
                        <td>
                        <input type="button" class="addticket" value="Add Parts" onclick=
                        "addpartInput('dynamic#count#Input')">
                        </td>
                        </tr>
                        </table>
                        
                        
                        <!---Shows what was previously entered into parts table--->
                        <!---dbtype="query"--->
                        <cfquery name="getparts" dbtype="query" >
                        SELECT *
                        FROM parts
                        WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
                        cfsqltype="cf_sql_char" maxLength="20">
                        </cfquery>
                        <cfset count1 = 0>
                        <!---<cfif serial.recordcount is 0>--->
                        <cfloop query="getparts">
                        <cfset count1 = count1 + 1>
                        <div id="part#count1#Name#count#">
                        <!---THIS IS THE PARTS SECTION--->
                        <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                        <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th>
                        <tr>
                        <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></td>
                        <td>
                        Parts been returned*
                        <input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/>
                        </td>
                        <td>
                        <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
                        </td>
                        </tr>
                        </table>
                        <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count#">--->
                        
                        
                        <!--- 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 1000 characters. )
                        <br/>
                        <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea>
                        </td>
                        </tr>
                        </table>
                        
                        
                        <!--- Adds Delete to every ticket  --->
                        <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                        <tr>
                        <td>
                        <input type="button" class="removeticket" value="Remove Parts #count1#" 
                        onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a>
                        </td>
                        </td>
                        </tr>
                        </table>
                        </div>
                        </cfloop>
                        </div> 
                        </cfoutput>
                        <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
                        
                        
                        <!---If have any blanks in serial table it will make field appear--->
                        <cfoutput query="serial">
                        <cfset model_no = #model_no#>
                        <cfset product_type = #product_type#>
                        <cfset type_hardware_failure = #type_hardware_failure#>
                        <cfset pka_serialNo = #pka_serialNo#>
                        <cfset software_hardware = #software_hardware#>
                        <cfset description = #description#>
                        <cfset resolution = #resolution#>
                        <cfset resolution_date = #resolution_date#>
                        <cfset resolution_verified_by = #resolution_verified_by#>
                        <cfset verification_date = #verification_date#>
                        <cfset dept_responsibility = #dept_responsibility#>
                        </cfoutput>
                        <cfif serial.recordcount is 0>
                        <cfset model_no = "">
                        <cfset product_type = "">
                        <cfset type_hardware_failure = "">
                        <cfset pka_serialNo = "">
                        <cfset software_hardware = "">
                        <cfset description = "">
                        <cfset resolution = "">
                        <cfset resolution_date = "">
                        <cfset resolution_verified_by = "">
                        <cfset verification_date = "">
                        <cfset dept_responsibility = "">
                        <cfinclude template="serialdisplay.cfm">
                        </cfif>
                        
                        <!---Parts Information, display parts if have or don't have a value--->
                        <cfoutput query="parts">
                        <cfset hc_partNo = #hc_partNo#>
                        <cfset part_returned = #part_returned#>
                        <cfset defective = #defective#>
                        <cfset rma_number = #rma_number#>
                        <cfinclude template="partsdisplay.cfm">
                        </cfoutput>
                        <cfif parts.recordcount is 0>
                        <cfset hc_partNo = "">
                        <cfset part_returned = "">
                        <cfset defective = "">
                        <cfset rma_number = "">
                        <cfinclude template="partsdisplay.cfm">
                        </cfif>
                        
                        </div>
                             <input type="button" class="addticket" value="Add Serial" onClick="addInput('dynamicInput');" >
                        
                        <!--- Submit --->
                        <table>
                        <tr>
                        <td>
                        <input type="submit" class="officalsubmit" value="submit" name="submit" onClick="return validate_form();">
                        </td>
                        </tr>
                        </table>
                        </form>
                        and where do i need the cfloop list at?

                        Thank you,
                        Rach

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          I see. Can you post the code for userformedit.cf m?

                          Add the cfloop before the input field line. It should create a string starting from 1 to #count#.

                          Comment

                          • bonneylake
                            Contributor
                            • Aug 2008
                            • 769

                            Originally posted by acoder
                            I see. Can you post the code for userformedit.cf m?

                            Add the cfloop before the input field line. It should create a string starting from 1 to #count#.
                            Hey Acoder,

                            Here is what is on the userformedit.cf m page

                            Code:
                            <!---Inserts information into serial table.--->
                            <CFIF REQUEST_METHOD EQ "POST">
                            <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 thedescription  = Form["thedescription_" & machineCount]>
                            
                             
                            <!--- inserts information into the serial table--->
                            <cfquery name="serialinsertupdate" datasource="CustomerSupport">
                               exec usp_CS_UpdateInsertserial 
                                 <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
                                 "#Form.pk_ticketID#",
                                 <cfqueryparam value="#modelno#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#producttype#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#softhardware#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#resolution#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#resdate#">,
                                 <cfqueryparam value="#resvertified#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#vertifidate#">,
                                 <cfqueryparam value="#deptvendor#" CFSQLType = "CF_SQL_VARCHAR">,
                                 <cfqueryparam value="#hardwarefailure#" CFSQLType = "CF_SQL_VARCHAR">   
                                 </cfquery>
                               
                               
                               
                            <!---Inserts information into notes_descr table.--->
                            <cfquery name="description" datasource="CustomerSupport">
                                exec usp_CS_Insertdescription
                               <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
                               '#Form.pk_ticketID#',
                               <cfqueryparam value="#thedescription#" CFSQLType = "CF_SQL_VARCHAR">,
                               '#Form.fk_addedBy#'
                            </cfquery>
                            
                            
                            
                            
                            <!---Inserts parts information into parts table.--->
                            <!---because it is a bit we don't use 'ticks' around defective for parts table--->
                            <cfloop list="#form['part2count' & machinecount]#" index="ps">
                            <cfparam name="Form.defective_#ps#_#machinecount#" default="0">
                            <cfparam name="Form.partsreturn_#ps#_#machinecount#" default="0">
                            <CFSET hcpn            = Form["hcpn_" & "#ps#" & "_#machinecount#"]>
                            <CFSET partsreturn     = Form["partsreturn_" & "#ps#" & "_#machinecount#"]>
                            <CFSET defective       = Form["defective_" & "#ps#" & "_#machinecount#"]>
                            <CFSET rma             = Form["rma_" & "#ps#" & "_#machineCount#"]>
                            <cfquery name="parts" datasource="CustomerSupport">
                                exec usp_CS_Updateparts 
                                <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">,
                                '#Form.pk_ticketID#',
                                <cfqueryparam value="#hcpn#" CFSQLType = "CF_SQL_VARCHAR">,
                                <cfqueryparam value="#partsreturn#" CFSQLType = "CF_SQL_VARCHAR">,
                                <cfqueryparam value="#defective#" CFSQLType = "CF_SQL_BIT">,
                                <cfqueryparam value="#rma#" CFSQLType = "CF_SQL_VARCHAR">
                            </cfquery>
                            </cfloop>
                            an would this be correct for the cfloop. i have it in the update part of the form.

                            Code:
                            <cfloop from="1" to="#count#" index="counttheparts">
                            <input type="hidden" name="part2count#count#" id="part2count#count#" value="#count#">
                            </cfloop>
                            an i noticed another problem with the insert :(, you know how we created another count for parts? well i need to do the same thing for serial because if you skip one serial it has a similar fit as parts did.


                            Thank you,
                            Rach

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              Yes, you'll need to update the input field named serialcount too.

                              For the cfloop, create a string using cfset and then set value to this string in place of #count#:
                              Code:
                              <cfset partliststr = "">
                              <cfloop ...>
                              <cfset partliststr = partliststr & ...>
                              </cfloop>
                              <input ...>
                              From your update page code, it seems that you might have to make a few alterations, but let's get this part working first.

                              Comment

                              • bonneylake
                                Contributor
                                • Aug 2008
                                • 769

                                Originally posted by acoder
                                Yes, you'll need to update the input field named serialcount too.

                                For the cfloop, create a string using cfset and then set value to this string in place of #count#:
                                Code:
                                <cfset partliststr = "">
                                <cfloop ...>
                                <cfset partliststr = partliststr & ...>
                                </cfloop>
                                <input ...>
                                From your update page code, it seems that you might have to make a few alterations, but let's get this part working first.
                                Hey Acoder,

                                would something like this be correct?

                                Code:
                                <cfset partliststr = "pl">
                                <cfloop from="1" to="#count#" index="pl">
                                <cfset partliststr = partliststr & #pl#>
                                </cfloop>
                                <input type="hidden" name="part2count#count#" id="part2count#count#" value="#count#">
                                an i started working on the serial part an making a seperate count for it, well atleast tempting to. So far in the serial function i added (i have it commented out so it wont affect anything). but i added

                                Code:
                                var serialc = 'sc'+count;
                                an then i added a hidden field of

                                Code:
                                "<input type='hidden' name='"+serialc+"' id='"+serialc+"' value=''>" +
                                an well i added only this to the delete of the serial function but i got confused when i got to delete

                                Code:
                                var getserial = document.getElementByID('serialc');
                                Thank you,
                                Rach

                                Comment

                                Working...