URL Method for 3 tables?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #91
    OK, remove the <cfoutput> from around <cfinclude> and see if that makes a difference.

    Comment

    • bonneylake
      Contributor
      • Aug 2008
      • 769

      #92
      Hey Acoder,

      Alrighty this is kinda weird to explain. When i look at a record that has no values its having a problem with the first drop down box (part_returned) that appears saying it cant determine value of parameter.

      If i look at a record that has values applied to it, all the fields work except
      the #hc_partNo#, #followup_date# , and #number_onsite# .

      Here is what i have on the main page

      Code:
      <cfoutput query="ticket">
      <cfset followup_date = #followup_date#>
      <cfset onsite_flag = #onsite_flag#>
      <cfset number_onsite = #number_onsite#>
      </cfoutput>
      
      <cfoutput query="parts">
      <cfset hc_partNo = #hc_partNo#>
      <cfset part_returned = #part_returned#>
      <cfset defective = #defective#>
      <cfset submission = #submission#>
      </cfoutput>
      <cfinclude template="partsdisplay.cfm">
      here is what on partsdisplay.cf m

      Code:
      <table class="createticketables" id="spaceup" >
      <th class="sectiontitle" colspan="7">Parts Information</th>
      <tr>
      <td class="indent" id="formfieldpadding">HC P/N:&nbsp;&nbsp;&nbsp;<input type="text" name="hcpn" style="margin:0px" value="#hc_partNo#"></td>
      <td class="red">
      Have all parts been returned*
      <select name="partsreturn" id="partsreturn">
      <option value="" selected>Make A Selection</option>
      <option value="N/A"<cfif #part_returned# is "N/A">selected</cfif>>N/A</option>
      <option value="No"<cfif #part_returned# is "No">selected</cfif>>No</option>
      <option value="Yes"<cfif #part_returned# is "Yes">selected</cfif>>Yes</option>
      </select>
      </td>
      <td>
      <td class="indent">Defective<input type="checkbox" name="defective" value="#defective#"<cfif #defective# eq "1">checked=yes</cfif>/></td>
      </td>
      </tr>
      </table>
      
      <table class="createticketables" >
      <tr>
      <td class="indent"  id="formfieldpadding">Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;<input type="text" name="followdate" value="#followup_date#" size="8"/>&nbsp;&nbsp;&nbsp;Current Date<input type="checkbox" name="followcheck" value="" onClick="followdate.value=fill_date()"/></td>
      <td>On Site:</td>
      <td>
      <select name="onsite" id="onsite">
      <option value="" selected>No Choice</option>
        <option value="Yes"<cfif #onsite_flag# is "Y">selected</cfif>>Yes</option>
        <option value="No"<cfif #onsite_flag# is "N">selected</cfif>>No</option>
      </select>
      </td>
      <td>Number of Onsite:</td>
      <td>
      <select name="numonsite">
      <option value="" selected>No Choice</option>
      <cfloop from="0" to="10" index="nonsite">
      <option value="#nonsite#"<cfif #number_onsite# is #nonsite#>selected</cfif>>#nonsite#
      </option></cfloop>
      </select>
      </td>
      </tr>
      </table>
      
      
      
      <table class="createticketables" id="space">
      <tr>
      <td class="indent" id="formfieldpadding">Submission:
      <select class="submissionticketbox" name="submission">
      <option value="" selected>Make a Selection</option>
        <option value="Phone"<cfif #submission# is "Phone">selected</cfif>>Phone</option>
        <option value="Techmail"<cfif #submission# is "Techmail">selected</cfif>>Techmail</option>
        <option value="Request"<cfif #submission# is "Request">selected</cfif>>Request</option>
      </select>
      </td>
      </tr>
      </table>
      Thank you,
      Rach

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #93
        I didn't mean that you should remove the whole cfif part, just the cfoutput tags, i.e.
        Code:
        <cfif parts.recordcount is 0>
        <cfset hc_partNo = "">
        <cfset part_returned = "">
        <cfset defective = "">
        <cfset submission = "">
        <cfinclude template="partsdisplay.cfm">
        </cfif>

        Comment

        • bonneylake
          Contributor
          • Aug 2008
          • 769

          #94
          Originally posted by acoder
          I didn't mean that you should remove the whole cfif part, just the cfoutput tags, i.e.
          Code:
          <cfif parts.recordcount is 0>
          <cfset hc_partNo = "">
          <cfset part_returned = "">
          <cfset defective = "">
          <cfset submission = "">
          <cfinclude template="partsdisplay.cfm">
          </cfif>
          Hey Acoder,

          I am confused am i only suppose to have

          Code:
          <cfif parts.recordcount is 0>
          <cfset hc_partNo = "">
          <cfset part_returned = "">
          <cfset defective = "">
          <cfset submission = "">
          <cfinclude template="partsdisplay.cfm">
          </cfif>
          or

          Code:
          <cfoutput query="parts">
          <cfset hc_partNo = #hc_partNo#>
          <cfset part_returned = #part_returned#>
          <cfset defective = #defective#>
          <cfset submission = #submission#>
          </cfoutput>
          <cfinclude template="partsdisplay.cfm">
          having it the way you have the example above. if i look at a blank record it shows the table an it shows none of the fields having a value. except in hc p/n, followup_date.

          if i looked at a record with values the table don't appear.

          Thank you,
          Rach

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #95
            Actually a combination of the two rather similar to serials:
            Code:
            <cfoutput query="parts">
            <cfset hc_partNo = #hc_partNo#>
            <cfset part_returned = #part_returned#>
            <cfset defective = #defective#>
            <cfset submission = #submission#>
            <cfinclude template="partsdisplay.cfm">
            </cfoutput>
            <cfif parts.recordcount is 0>
            <cfset hc_partNo = "">
            <cfset part_returned = "">
            <cfset defective = "">
            <cfset submission = "">
            <cfinclude template="partsdisplay.cfm">
            </cfif>

            Comment

            • bonneylake
              Contributor
              • Aug 2008
              • 769

              #96
              Hey Acoder,

              it looks like its "almost" there. It shows the table it gives the correct value for most of the fields except 3 of them. the 3 fields are

              #hc_partNo#
              #followup_date#
              #number_onsite#

              but i got no clue what is causing it the names match up unless i somehow did it wrong in the partsdisplay.cf m

              heres everything in the main page

              Code:
              <cfoutput query="ticket">
              <cfset followup_date = #followup_date#>
              <cfset onsite_flag = #onsite_flag#>
              <cfset number_onsite = #number_onsite#>
              </cfoutput>
              
              <cfoutput query="parts">
              <cfset hc_partNo = #hc_partNo#>
              <cfset part_returned = #part_returned#>
              <cfset defective = #defective#>
              <cfset submission = #submission#>
              <cfinclude template="partsdisplay.cfm">
              </cfoutput>
              <cfif parts.recordcount is 0>
              <cfset hc_partNo = "">
              <cfset part_returned = "">
              <cfset defective = "">
              <cfset submission = "">
              <cfinclude template="partsdisplay.cfm">
              </cfif>
              an here is what those 3 fields look like in partsdisplay.cf m



              Code:
              <td class="indent" id="formfieldpadding">HC P/N:&nbsp;&nbsp;&nbsp;<input type="text" name="hcpn" style="margin:0px" value="#hc_partNo#"></td>
              
              <td class="indent"  id="formfieldpadding">Follow up Date:(MM/DD/YYYY)&nbsp;&nbsp;&nbsp;<input type="text" name="followdate" value="#followup_date#" size="8"/>&nbsp;&nbsp;&nbsp;Current Date<input type="checkbox" name="followcheck" value="" onClick="followdate.value=fill_date()"/></td>
              
              
              <td>Number of Onsite:</td>
              <td>
              <select name="numonsite">
              <option value="" selected>No Choice</option>
              <cfloop from="0" to="10" index="nonsite">
              <option value="#nonsite#"<cfif #number_onsite# is #nonsite#>selected</cfif>>#nonsite#
              </option></cfloop>
              </select>
              </td>
              Thank you,
              Rach

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #97
                I think you will need the <cfoutput> tags around those variables, but then that wouldn't work for the first part, so try this:
                Code:
                <cfoutput query="parts">
                <cfset hc_partNo = #hc_partNo#>
                <cfset part_returned = #part_returned#>
                <cfset defective = #defective#>
                <cfset submission = #submission#>
                <cfinclude template="partsdisplay.cfm">
                </cfoutput>
                <cfif parts.recordcount is 0>
                <cfset hc_partNo = "">
                <cfset part_returned = "">
                <cfset defective = "">
                <cfset submission = "">
                <cfoutput><cfinclude template="partsdisplay.cfm"></cfoutput>
                </cfif>

                Comment

                • bonneylake
                  Contributor
                  • Aug 2008
                  • 769

                  #98
                  Hey Acoder,

                  Well tried that an it didn't work. But i did figure it out. In the partsdisplay.cf m i wrapped it all in just a simple <cfoutput> </cfoutput> and used the code you had in your last post on my main page an now its working :)

                  Thank you,
                  Rach
                  Last edited by acoder; Oct 3 '08, 01:40 PM. Reason: Removed irrelevant parts

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #99
                    Great to see that you finally managed the parts problem. I think it could be improved further in terms of efficiency/performance if you avoid using cfoutput around the whole file and use it only where you have Coldfusion variables output.
                    Last edited by acoder; Oct 3 '08, 01:41 PM. Reason: Removed parts

                    Comment

                    • bonneylake
                      Contributor
                      • Aug 2008
                      • 769

                      Hey Acoder,

                      Yeah i probably will end up changing the cfouput so its only around what is needed.But THANK YOU SO MUCH FOR ALL THE HELP!!!
                      Rach
                      Last edited by acoder; Oct 3 '08, 01:42 PM. Reason: Removed text

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        Since this is a new problem that's not going to be solved in one or two posts, I've split off and created a new thread for the new question here. Continue the discussion there. Any improvements to the serials/parts display can, of course, continue here.

                        Comment

                        • bonneylake
                          Contributor
                          • Aug 2008
                          • 769

                          Originally posted by acoder
                          Since this is a new problem that's not going to be solved in one or two posts, I've split off and created a new thread for the new question here. Continue the discussion there. Any improvements to the serials/parts display can, of course, continue here.
                          Hey Acoder,

                          I actually have another question concerning parts. The way the information goes into onsite_flag field in the database it appears as a Y or N and i was wondering how could i make it appear to the user as Yes or No.I tried to do it similar to the
                          checkbox where you would do this

                          Code:
                          <cfif #defective# eq 1>
                          		Yes
                          	<cfelse>
                          	No
                          	</cfif>
                          i changed #defective# to #onsite_flag# and the 1 to Y but it didn't seem to work. Anyway to make it do something like this?

                          Thank you,
                          Rach

                          Comment

                          • bonneylake
                            Contributor
                            • Aug 2008
                            • 769

                            Originally posted by bonneylake
                            Hey Acoder,

                            I actually have another question concerning parts. The way the information goes into onsite_flag field in the database it appears as a Y or N and i was wondering how could i make it appear to the user as Yes or No.I tried to do it similar to the
                            checkbox where you would do this

                            Code:
                            <cfif #defective# eq 1>
                            		Yes
                            	<cfelse>
                            	No
                            	</cfif>
                            i changed #defective# to #onsite_flag# and the 1 to Y but it didn't seem to work. Anyway to make it do something like this?

                            Thank you,
                            Rach
                            Hey Acoder,

                            I figured it out. Not sure what i was doing wrong. but in case anyone wanted to know here is what i did

                            Code:
                            <cfif #onsite_flag# eq "Y">
                            Yes
                            <cfelse>
                            No
                            </cfif>
                            but i do got another question. If you get the date from your table, is there anyway to make the date display different? i use the field #followup_date#
                            to display the date but when it displays it does this 2008-09-23 00:00:00
                            an would like to get rid of the zeros on the end and was just wondering how i could make it so it only display the 2008-09-23?

                            Thank you again for all the help,
                            Rach

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              Use the DateFormat function with the appropriate mask.

                              Comment

                              • bonneylake
                                Contributor
                                • Aug 2008
                                • 769

                                Originally posted by acoder
                                Use the DateFormat function with the appropriate mask.
                                Hey Acoder,

                                Bit confused on what you mean.This is how i had done it for a previous form

                                Code:
                                #DateFormat(now(),'mmm dd yyyy')#
                                . But the thing is it has to get the date that was entered into #followupdate#

                                Thank you,
                                Rach

                                Comment

                                Working...