displaying previously entered multiple fields

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

    Hey Acoder,

    I don't have the hidden input field in the partsdisplay.cf m page because it comes after the parts div. Should i add it to partsdisplay.cf m? i tried the following below but it didn't work. Didn't tell me the pacific problem just didn't work. An i tried moving the hidden field from the serialpartsdisp lay.cfm to partsdisplay.cf m an that didn't seem to make a difference no matter where it was.

    here is what i got in full on serialpartsdisp lay.cfm page is this correct?
    Code:
    <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>
    <cfloop query="getparts">
    <cfset count1 = count1 + 1>
    <cfset hc_partNo = #hc_partNo#>
    <cfset part_returned = #part_returned#>
    <cfset defective = #defective#>
    <cfset rma_number = #rma_number#>
    <cfinclude template="partsdisplay.cfm">
       </cfloop>
       <cfif getparts.recordcount is 0>
     <cfset count1 = 1>
    <cfset hc_partNo = "">
    <cfset part_returned = "">
    <cfset defective = ""> 
    <cfset rma_number = "">
      <cfinclude template="partsdisplay.cfm">
     </cfif>
    Thank you,
    Rach

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      What have you got in partsdisplay.cf m now? Were you not using parts.cfm earlier?

      Comment

      • bonneylake
        Contributor
        • Aug 2008
        • 769

        Hey Acoder,

        i changed the file name from parts.cfm to partsdisplay.cf m just so i would understand better what it does. But here is what i got in partsdisplay.cf m now.
        Code:
        <cfoutput>
        <div id="part#count1#Name#count#">
        <!---<cfset partliststr = "">
        <cfloop from="1" to="#count1#" index="pl">
        <cfset partliststr = partliststr & #pl# & ",">
        </cfloop>
        
        <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
        <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
        
        <!---THIS IS THE PARTS SECTION--->
        
        <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
        
        <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>
        
        </cfoutput>
        Thank you :),
        Rach

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          You don't need cfoutput in there because it's already contained within cfoutput tags where it's included.

          Comment

          • bonneylake
            Contributor
            • Aug 2008
            • 769

            Hey Acoder,

            Taking out the cfoutput tags helped an didn't help. The parts section shows up now. But if a part was or was not filled out it does not display what is suppose to be in there it instead just displays the value for the field an for the count, it displays the value #count# instead of the number.Any ideas?

            Thank you,
            Rach

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              What could probably solve all this is to only put cfoutput where it's needed and not around a whole page of code. So remove the cfoutput at the beginning and end of serialpartsdisp lay.cfm and put it around each Coldfusion variable not in a Coldfusion tag.

              Comment

              • bonneylake
                Contributor
                • Aug 2008
                • 769

                Hey Acoder,

                are you meaning to do something like this? because i tried it an it wont allow me to add or remove parts. an also thought of a question. The way we are doing if, if there are serials with no parts applied to it will it add a blank part to them as well instead of just when there is a blank serial?
                an if it will is there a way to make a blank parts come up only when a serial is not filled in?
                Code:
                <!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP--->
                
                <!--- Shows what was previously entered for Model No, Product Type, and Type of Hardware Failure  --->
                <cfoutput>
                <div id="dynamic#count#Input"> </cfoutput>
                <table class="zpExpandedTable" id="modeltable"> 
                <th class="sectiontitletick" colspan="7">
                Serial Information<cfoutput> #count# </cfoutput></th>
                <tr>
                <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
                </td>
                <td>
                <cfoutput>
                <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></cfoutput></td>
                <td>
                &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
                </td>
                <td>
                <cfoutput>
                <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></cfoutput>
                </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>
                <cfoutput>
                <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></cfoutput>
                </td>
                </tr>
                <table>
                 
                <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
                <table class="zpExpandedTable" id="modeltable">
                <tr>
                <td id="paddingformultitop">
                <cfoutput>
                Serial Number:&nbsp;&nbsp;
                <input type="text" name="serialnum_#count#" value="#pka_serialNo#"></cfoutput>
                <cfoutput>&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>
                </cfoutput>
                </td>
                </tr>
                </table>
                
                <!--- Shows what was previously entered for Description ---> 
                
                 <cfquery name="getnotes" dbtype="query" >
                SELECT *
                FROM notes
                WHERE fk_serialNo=<cfqueryparam value="#pka_serialNo#" 
                cfsqltype="cf_sql_char" maxLength="20">
                </cfquery>
                <cfloop query="getnotes">
                
                <input type="hidden" name="pk_num_#count#" id="pk_num" value="" /></cfloop>
                <!---<div style="width: 150px; height: 150px; overflow-y: scroll; scrollbar-arrow-color:blue; 
                scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888;">--->
                <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
                <tr><td id="paddingformutli">
                Previously Submitted Descriptions:</td><td id="paddingformutli">
                <div id="descriptionbox" style="HEIGHT:100px; WIDTH:500px; OVERFLOW:auto;" >
                <cfloop query="getnotes">
                Added By: #fk_addedBy# <br/>
                Dated Added: #DateFormat(date_stamp,'mm/dd/yyyy')#<br/><br/>
                #description#
                <div id="line"></div>
                </cfloop></div></td>
                
                </tr>
                </table>
                <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
                <tr>
                <!---<input type="hidden" name="thedescriptoin_#count#" id="thedescriptoin" value="#description#" />--->
                <td id="paddingformutli">
                Description:&nbsp;&nbsp;
                </td>
                <td class="descriptionmoveinmulti">
                
                ( You may enter up to 1000 characters. )
                <br><cfoutput>
                <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea></cfoutput>
                
                </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>
                <cfoutput>
                <textarea  maxlength="1500" onkeyup="return resolutionismaxlength(this)" onkeydown="return resolutionismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea></cfoutput>
                </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>
                <cfoutput>
                <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()"></cfoutput>
                </td>
                <td>
                Resolution Verified as effective by:&nbsp;&nbsp;
                </td>
                <td>
                <cfoutput>
                <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>
                </cfoutput>
                </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">
                <cfoutput>
                <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()">
                </cfoutput>
                </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;
                <cfoutput>
                <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>
                </cfoutput>
                </td>
                </tr>
                </table>
                <cfoutput>
                <input type="hidden" name="serialcount" id="serialcount" value="#count#">
                </cfoutput>
                
                
                <!--- Adds Delete to every ticket  --->
                <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                <tr>
                <td>
                <cfoutput>
                <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')">
                </cfoutput>
                </td>
                </tr>
                <tr>
                <td>
                <cfoutput>
                <input type="button" class="addticket" value="Add Parts" onClick="addpartInput('dynamic#count#Input')">
                </cfoutput>
                </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>--->
                <!---The template is where most of the parts section is held--->
                <!---<cfinclude template="partsdisplay.cfm">--->
                
                
                <cfset count1 = 0>
                
                <cfoutput query="getparts">
                <cfset count1 = count1 + 1>
                <cfset hc_partNo = #hc_partNo#>
                <cfset part_returned = #part_returned#>
                <cfset defective = #defective#>
                <cfset rma_number = #rma_number#>
                <cfinclude template="partsdisplay.cfm">
                </cfoutput>
                   <cfif getparts.recordcount is 0>
                 <cfset count1 = 1>
                <cfset hc_partNo = "">
                <cfset part_returned = "">
                <cfset defective = ""> 
                <cfset rma_number = "">
                  <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
                 </cfif>
                
                 
                <cfoutput><input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/></cfoutput>
                <!---</cfloop>
                --->
                 
                </div>
                <!---this one makes it so you can add a part to a previously submitted serial--->
                <!---<input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" />--->
                Thank you,
                Rach

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  Originally posted by bonneylake
                  are you meaning to do something like this? because i tried it an it wont allow me to add or remove parts.
                  What happens? Do you get an error? The general idea is correct, though you could change where you put the cfoutput.
                  Originally posted by bonneylake
                  an also thought of a question. The way we are doing if, if there are serials with no parts applied to it will it add a blank part to them as well instead of just when there is a blank serial?
                  an if it will is there a way to make a blank parts come up only when a serial is not filled in?
                  Yes, add a check for when serial count is 0 too when displaying a blank part.

                  Comment

                  • bonneylake
                    Contributor
                    • Aug 2008
                    • 769

                    Hey Acoder,

                    Well i discovered something weird today. I had original made a copy of serialpartsdisp lay.cfm to apply the new idea we had where we wrapped each seperate section in cfoutput. Anyway when i went to look this morning with the old serialpartdispl ay.cfm I clicked on add part an it seemed to be counting right except for the first part displayed. So i I ended up wrapping only the required sections in parts and that seemed to work some what. however, for some reason i can not wrap the following 2 things in cfoutput or i get errors and i am not able to delete the first part.

                    Code:
                    <div id="part#count1#Name#count#">
                    <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
                    this is what i tried in full on the partsdisplay.cf m page

                    Code:
                    <div id="part#count1#Name#count#">
                    <!---<cfset partliststr = "">
                    <cfloop from="1" to="#count1#" index="pl">
                    <cfset partliststr = partliststr & #pl# & ",">
                    </cfloop>
                    
                    <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
                    <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
                    
                    <!---THIS IS THE PARTS SECTION--->
                    
                    <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
                    
                    <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                    <th class="sectiontitle" colspan="7"><cfoutput>Parts Information #count1# Serial Information #count#</cfoutput></th>
                    <tr>
                    <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<cfoutput><input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></cfoutput></td>
                    <td>
                    Parts been returned*
                    <cfoutput><input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/></cfoutput>
                    </td>
                    <td>
                    <td class="indent">Defective<cfoutput><input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></cfoutput></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/>
                    <cfoutput>
                    <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></cfoutput></td>
                    </tr>
                    </table>
                    
                    
                    <!--- Adds Delete to every ticket  --->
                    <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                    <tr>
                    <td>
                    <cfoutput>
                    <input type="button" class="removeticket" value="Remove Parts #count1#" 
                    onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a></cfoutput>
                    </td>
                    </td>
                    </tr>
                    </table>
                    
                    </div>
                    <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>--->
                    an how would i add a check for the serial count is 0?because i got on cticketpage2edi t.cfm the following an it does the serial is 0 but i don't know how to make it where if a serial is empty is only when a part will appear.

                    Code:
                    <cfset count = 0>
                     <cfoutput query="serial">
                     <cfset count = count + 1>
                     <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 resolution = #resolution#>
                     <cfset resolution_date = #resolution_date#>
                     <cfset resolution_verified_by = #resolution_verified_by#>
                      <cfset verification_date = #verification_date#>
                     <cfset dept_responsibility = #dept_responsibility#>
                     <cfinclude template="serialpartsdisplay.cfm">
                       </cfoutput>
                    
                    <!---  If fields in the serial was not added it shows the blank field/ or it will show the whole table if no serial was submitted (parts table works the same way). parts is in serialpartsdisplay.cfm--->
                     <cfif serial.recordcount is 0>
                     <cfset count = 1>
                     <cfset model_no = "">
                     <cfset product_type = "">
                     <cfset type_hardware_failure = "">
                     <cfset pka_serialNo = "">
                     <cfset software_hardware = "">
                     <cfset resolution = "">
                     <cfset resolution_date = "">
                     <cfset resolution_verified_by = "">
                     <cfset verification_date = "">
                     <cfset dept_responsibility = "">
                       <cfoutput><cfinclude template="serialpartsdisplay.cfm"></cfoutput>
                     </cfif>
                    Thank you,
                    Rach

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      Have you got the partsdisplay.cf m include file wrapped in cfoutput in serialpartsdisp lay.cfm?

                      For the serial count, when checking parts count just add a check for serial count too, e.g.
                      Code:
                      <cfif serial.recordcount is 0 and parts.recordcount is 0>

                      Comment

                      • bonneylake
                        Contributor
                        • Aug 2008
                        • 769

                        Hey Acoder,

                        The checking parts count worked beautiful. But i can still not get the parts. I have the
                        parts wrapped as below

                        Code:
                        <cfoutput query="getparts">
                        <cfset count1 = count1 + 1>
                        <cfset hc_partNo = #hc_partNo#>
                        <cfset part_returned = #part_returned#>
                        <cfset defective = #defective#>
                        <cfset rma_number = #rma_number#>
                        <cfinclude template="partsdisplay.cfm">
                           </cfoutput>
                           <cfif serial.recordcount is 0 and getparts.recordcount is 0>
                         <cfset count1 = 1>
                        <cfset hc_partNo = "">
                        <cfset part_returned = "">
                        <cfset defective = ""> 
                        <cfset rma_number = "">
                          <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
                         </cfif>
                        an then inside the partsdisplay.cf m is in post 429.The problem is witht he div in partsdisplay.cf m. When i go an look using firebug it is not counting or doing anything. If i wrap the div itself in cfoutput it does not work an i get an error. Could it be possible that if i took the beginning div an the end div an put it in serialpartsdisp lay.cfm but leave everything between the div on partsdisplay.cf m that it might work?

                        Thank you,
                        Rach

                        Comment

                        • bonneylake
                          Contributor
                          • Aug 2008
                          • 769

                          Hey Acoder,

                          i got the parts working sorta so ignore post 431. I was able to do the following in partsdisplay.cf m an this allowed me to remove the first part added
                          Code:
                          <cfoutput><div id="part#count1#Name#count#"></cfoutput>.
                          However, i am noticing another problems. for some reason if i do not add a part an i go an submit on the print ticket page it shows the following parts information 0 serial 1.. an it does it to every part i add as well. there is always a 0 at the beginning even if i only add part 2 and 4 it will display 0,2,4.

                          I am also noticing if i add 2 parts to one serial it will only display one part instead of all the parts added.i know its because of the line below. I tried to wrap the whole line in cfoutput but it wouldn't let me
                          Code:
                          <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
                          here is what i got on partsdisplay.cf m


                          Code:
                          <cfoutput><div id="part#count1#Name#count#"></cfoutput>
                          <!---<cfset partliststr = "">
                          <cfloop from="1" to="#count1#" index="pl">
                          <cfset partliststr = partliststr & #pl# & ",">
                          </cfloop>
                          
                          <input type="hidden" name="part2count#count#" id="part2count#count#" value="#partliststr#">
                          <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#">--->
                          
                          <!---THIS IS THE PARTS SECTION--->
                          
                          <input type="hidden" name="pkpartID_#count1#_#count#" id="pkpartID" value="#pk_partID#" />
                          
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <th class="sectiontitle" colspan="7"><cfoutput>Parts Information #count1# Serial Information #count#</cfoutput></th>
                          <tr>
                          <td class='indent' id='formfieldpadding'>HC P/N:&nbsp;&nbsp;&nbsp;<cfoutput><input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value="#hc_partNo#"></cfoutput></td>
                          <td>
                          Parts been returned*
                          <cfoutput><input type="checkbox" name="partsreturn_#count1#_#count#" value="#part_returned#"<cfif #part_returned# eq "1">checked=yes</cfif>/></cfoutput>
                          </td>
                          <td>
                          <td class="indent">Defective<cfoutput><input type="checkbox" name="defective_#count1#_#count#" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></cfoutput></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/>
                          <cfoutput>
                          <textarea maxlength="1000" onkeyup="return rmaismaxlength(this)" onkeydown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" >#rma_number#</textarea></cfoutput></td>
                          </tr>
                          </table>
                          
                          
                          <!--- Adds Delete to every ticket  --->
                          <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
                          <tr>
                          <td>
                          <cfoutput>
                          <input type="button" class="removeticket" value="Remove Parts #count1#" 
                          onclick="removetheElement('part#count1#Name#count#',#count#,#count#)"></a></cfoutput>
                          </td>
                          </td>
                          </tr>
                          </table>
                          
                          </div>
                          <!---<input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>--->




                          Thank you,
                          Rach

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            You've got cfoutput outside partsdisplay.cf m, so you shouldn't require any cfoutput tags in the file.

                            Comment

                            • bonneylake
                              Contributor
                              • Aug 2008
                              • 769

                              Hey Acoder,


                              I tried to not having any cfoutput tags in partsdisplay.cf m. But when the first part loads (with no serial) it says parts information #count# an it does it for everything else in the file for some reason if i don't have cfoutput tags in there. With it, it does it correct except that one line mentioned above. but other wise for the first part that loads with no serial it wont work correctly.

                              here is what i got on serialpartsdisp lay.cfm for the parts section in it

                              Code:
                              <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>--->
                              
                              
                              
                              <!---The template is where most of the parts section is held--->
                              <!---<cfinclude template="partsdisplay.cfm">--->
                              <!---<cfset count1 = 0>--->
                              <cfoutput query="getparts">
                              <cfset count1 = count1 + 1>
                              <cfset hc_partNo = #hc_partNo#>
                              <cfset part_returned = #part_returned#>
                              <cfset defective = #defective#>
                              <cfset rma_number = #rma_number#>
                              <cfinclude template="partsdisplay.cfm">
                                 </cfoutput>
                                 <cfif serial.recordcount is 0 and getparts.recordcount is 0>
                               <cfset count1 = 1>
                              <cfset hc_partNo = "">
                              <cfset part_returned = "">
                              <cfset defective = ""> 
                              <cfset rma_number = "">
                                <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
                               </cfif>
                               
                               <cfoutput>
                              <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/>
                              <!---</cfloop>
                              --->
                               </cfoutput>
                              Thank you,
                              Rach

                              Comment

                              • acoder
                                Recognized Expert MVP
                                • Nov 2006
                                • 16032

                                Is serialpartsdisp lay.cfm in cfoutput tags? If it is, change the cfoutput query to cfloop and remove the cfoutput tags.

                                Comment

                                Working...