469,315 Members | 1,883 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

URL Method for 3 tables?

769 512MB
Hey Everyone,

i been working on trying to understand the URL method of retrieving information for the last week, but i am stuck. I been able to get one table of information, but now i need to get 3 tables of information at the same time an i am running into trouble. Each table has a number in common with the other, each has a field that holds the number (but fields have different name). For example ticketMaster table has the field pk_ticketID which holds the number 1, serial has the field pkb_fk_ticketNo which holds the number 1, and parts has the field fk_ticketNo which holds the number 1. Right now i can get the correct table information for ticketMaster but for the serial an parts i get all the records that are in those tables instead of just the one record needed, which in this case is the one record that holds the number 1.

Right now here is what i have


Expand|Select|Wrap|Line Numbers
  1.  <!---Shows what was previously entered into table ticketmaster--->
  2. <cfquery name="ticket" datasource="CustomerSupport">
  3.  SELECT pk_ticketID,title,priority,status,
  4. cost_center,fk_customer_number,
  5. customer_company,customer_Fname,customer_Lname,
  6. customer_add1,customer_city,customer_state,
  7. customer_zip,customer_email,customer_pri_phone,
  8. customer_sec_phone,customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  9. WHERE pk_ticketID = #URL.pk_ticketID#
  10. </cfquery>
  11.  
  12. <cfquery name="serial" datasource="CustomerSupport">
  13. SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type ,
  14. software_hardware,resolution,resolution_date,
  15. verification_date,rma_data,
  16. type_hardware_failure,dept_responsibility,resoluti on_verified_by FROM dbo.tbl_CS_serial
  17. </cfquery>
  18.  
  19. <cfquery name="parts" datasource="CustomerSupport">
  20. SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,
  21. part_returned,defective,submission
  22. FROM dbo.tbl_CS_parts
  23. </cfquery>
  24.  
  25. <form name="page1" id="page1" action="saveticket1edit.cfm?<cfoutput query="ticket">pk_ticketID=#pk_ticketID#</cfoutput><cfoutput query="serial">&pkb_fk_ticketNo=#pkb_fk_ticketNo#</cfoutput><cfoutput query="parts">&fk_ticketNo=#fk_ticketNo#</cfoutput>"
  26.  method="POST" onSubmit="return validate_form();">
  27. </form>
if anyone could explain to me how to get the url method to work with 3 fields in 3 different tables i would really appreciate it.

Thank you in advance,
Rach
Sep 22 '08 #1
107 7600
acoder
16,027 Expert Mod 8TB
You could combine all three into one query and perform a join operation. The best way would depend on the database and the dialect of SQL used, but a very simple way would be something like:
Expand|Select|Wrap|Line Numbers
  1. select ...
  2. from ticket, serial, parts
  3. where serial.fk_id = ticket.id and parts.fk_id = ticket.id
  4. and ticket.id = #url...#
You match the foreign keys with the primary key of the main table to avoid duplicates.
Sep 22 '08 #2
bonneylake
769 512MB
You could combine all three into one query and perform a join operation. The best way would depend on the database and the dialect of SQL used, but a very simple way would be something like:
Expand|Select|Wrap|Line Numbers
  1. select ...
  2. from ticket, serial, parts
  3. where serial.fk_id = ticket.id and parts.fk_id = ticket.id
  4. and ticket.id = #url...#
You match the foreign keys with the primary key of the main table to avoid duplicates.
Hey Acoder,

Well here is what i have, but its still not getting the right information, it still getting all the rows in the tables for serial and parts

Expand|Select|Wrap|Line Numbers
  1. <!---Shows what was previously entered into table ticketmaster--->
  2. <cfquery name="ticket" datasource="CustomerSupport">
  3.         SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
  4.         customer_company,customer_Fname,customer_Lname,customer_add1
  5. ,customer_city,customer_state,
  6.         customer_zip,customer_email,customer_pri_phone,
  7. customer_sec_phone,customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  8.         WHERE pk_ticketID = #URL.pk_ticketID#
  9. </cfquery>
  10.  
  11. <cfquery name="serial" datasource="CustomerSupport">
  12.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,
  13. resolution,resolution_date,
  14.          verification_date,rma_data,type_hardware_failure,dept_responsibility,
  15. resolution_verified_by FROM dbo.tbl_CS_serial
  16.  
  17. </cfquery>
  18.  
  19. <cfquery name="parts" datasource="CustomerSupport">
  20.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
  21.          FROM dbo.tbl_CS_parts
  22. </cfquery>
  23.  
  24.  
  25. <cfquery name="all" datasource="CustomerSupport">
  26.         SELECT *
  27.        FROM dbo.tbl_CS_ticketMaster,dbo.tbl_CS_serial,dbo.tbl_CS_parts
  28.         WHERE pkb_fk_ticketNo = pk_ticketID and pk_partID = pk_ticketID
  29.         and pk_ticketID =  #URL.pk_ticketID#
  30. </cfquery>
  31.  
  32. <cfoutput query="all">
  33. <form name="page1" id="page1" action="saveticket1edit.cfm?pk_ticketID=#pk_ticketID#"
  34. method="POST" onSubmit="return validate_form();">
  35. </cfoutput>
  36. </form>
  37.  
  38.  
  39.  
Thank you,
Rach
Sep 23 '08 #3
acoder
16,027 Expert Mod 8TB
What's the relationship between serial/parts and ticket. Is it many-to-one, i.e. many serials and parts to one ticket?
Sep 23 '08 #4
bonneylake
769 512MB
What's the relationship between serial/parts and ticket. Is it many-to-one, i.e. many serials and parts to one ticket?
Ok everytime someone inserts a ticket. ticket has one record (always), parts has one record (always) and serial can have multiple records. An there all suppose to share the same ticket like pkb_fk_ticketNo (for serial) has the same number as fk_serialNo (for parts) and pk_ticketID(for ticket). Hope that makes since, kinda hard to explain.

Thank you,
Rach
Sep 23 '08 #5
bonneylake
769 512MB
Hey Acoder,

Yes its many serials and parts to one ticket. They all share the same number in each table like if pk_ticketID (from ticket table) has the number 1, then pkb_fk_ticketNo (from serial table) has the number 1, and fk_ticketNo(from parts table) has the number 1. I figured out i had the wrong field for parts. But even changing it didn't seem to help. But here is the statement again
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="all" datasource="CustomerSupport">
  2.         SELECT *
  3.        FROM dbo.tbl_CS_ticketMaster,dbo.tbl_CS_serial,dbo.tbl_CS_parts
  4.  
  5.         WHERE pkb_fk_ticketNo = pk_ticketID and fk_ticketNo = pk_ticketID
  6.         and pk_ticketID =  #URL.pk_ticketID#
  7. </cfquery>
  8.  
Thank you again for all your help,
Rach
Sep 23 '08 #6
acoder
16,027 Expert Mod 8TB
To make things easier, you could use 3 queries as you had earlier.

As an example:
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="serial" datasource="CustomerSupport">
  2. SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type ,
  3. software_hardware,resolution,resolution_date,
  4. verification_date,rma_data,
  5. type_hardware_failure,dept_responsibility,resoluti on_verified_by FROM dbo.tbl_CS_serial
  6. WHERE pkb_fk_ticketno = #url.pk_ticketID#
  7. </cfquery>
Then you can get the serial and parts data separately.
Sep 24 '08 #7
bonneylake
769 512MB
To make things easier, you could use 3 queries as you had earlier.

As an example:
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="serial" datasource="CustomerSupport">
  2. SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type ,
  3. software_hardware,resolution,resolution_date,
  4. verification_date,rma_data,
  5. type_hardware_failure,dept_responsibility,resoluti on_verified_by FROM dbo.tbl_CS_serial
  6. WHERE pkb_fk_ticketno = #url.pk_ticketID#
  7. </cfquery>
Then you can get the serial and parts data separately.
Hey Acoder,

Thought i understood what you meant, but i am still having trouble.It still wont only get the serial and part associated with the ticket Here is what i have.

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="ticket" datasource="CustomerSupport">
  2.         SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
  3.         customer_company,customer_Fname,customer_Lname,customer_add1,
  4. customer_city,customer_state,
  5.         customer_zip,customer_email,customer_pri_phone,customer_sec_phone,
  6. customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  7.         WHERE pk_ticketID = #URL.pk_ticketID#
  8. </cfquery>
  9.  
  10. <cfquery name="serial" datasource="CustomerSupport">
  11.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware
  12. ,resolution,resolution_date,
  13.          verification_date,rma_data,type_hardware_failure,dept_responsibility
  14. ,resolution_verified_by FROM dbo.tbl_CS_serial
  15.           WHERE pkb_fk_ticketNo = #URL.pk_ticketID#
  16. </cfquery>
  17.  
  18. <cfquery name="parts" datasource="CustomerSupport">
  19.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective
  20. ,submission
  21.          FROM dbo.tbl_CS_parts
  22.          WHERE fk_ticketNo = #URL.pk_ticketID#
  23. </cfquery>
  24.  
  25. <cfoutput>
  26. <form name="page1" id="page1" action="saveticket1edit.cfm?pk_ticketID=#pk_ticketID#"
  27. method="POST" onSubmit="return validate_form();">
  28. </cfoutput>
Any suggestions?

Thank you for all the help :),
Rach
Sep 24 '08 #8
acoder
16,027 Expert Mod 8TB
Where's the code for outputting the data?
Sep 24 '08 #9
bonneylake
769 512MB
Where's the code for outputting the data?
Hey Acoder,

Not sure what you mean, bit confused. i don't know if this is what you mean but here is all i have

page 1

Expand|Select|Wrap|Line Numbers
  1. <!---Shows what was previously entered into table ticketmaster--->
  2. <cfquery name="ticket" datasource="CustomerSupport">
  3.         SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
  4.         customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,customer_state,
  5.         customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  6.         WHERE pk_ticketID = #URL.pk_ticketID#
  7. </cfquery>
  8.  
  9. <cfquery name="serial" datasource="CustomerSupport">
  10.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
  11.          verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
  12.           WHERE pkb_fk_ticketNo = #URL.pk_ticketID#
  13. </cfquery>
  14.  
  15. <cfquery name="parts" datasource="CustomerSupport">
  16.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
  17.          FROM dbo.tbl_CS_parts
  18.          WHERE fk_ticketNo = #URL.pk_ticketID#
  19. </cfquery>
  20.  
  21. <cfoutput>
  22. <form name="page1" id="page1" action="saveticket1edit.cfm?pk_ticketID=#pk_ticketID#"
  23. method="POST" onSubmit="return validate_form();">
  24. </cfoutput>

an heres whats on page 2

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="ticket" datasource="CustomerSupport">
  2.         SELECT pk_ticketID,title,priority,status,cost_center,followup_date,fk_customer_number,
  3.         customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,customer_state,
  4.         customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_notes,onsite_flag,number_onsite,htpp FROM          dbo.tbl_CS_ticketMaster
  5.         WHERE pk_ticketID = #URL.pk_ticketID#
  6. </cfquery>
  7.  
  8. <cfquery name="serial" datasource="CustomerSupport">
  9.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
  10.          verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
  11. </cfquery>
  12.  
  13. <cfquery name="parts" datasource="CustomerSupport">
  14.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
  15.          FROM dbo.tbl_CS_parts
  16.  
  17.  
  18. </cfquery>
Thank you,
Rach
Sep 24 '08 #10
acoder
16,027 Expert Mod 8TB
You mentioned in the first post that you're able to get one table of information, but not three. When you get the table data using cfquery, you must be using it somewhere, e.g. cfoutput, cfloop to display it or otherwise make use of it. Also, what's the purpose of that form?
Sep 24 '08 #11
bonneylake
769 512MB
You mentioned in the first post that you're able to get one table of information, but not three. When you get the table data using cfquery, you must be using it somewhere, e.g. cfoutput, cfloop to display it or otherwise make use of it. Also, what's the purpose of that form?
Hey Acoder,

Ok here is how i do it.

On the index.cfm page i have this.

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="ticket" datasource="CustomerSupport">
  2.         SELECT pk_ticketID,status,title,date_last_modified,date_submitted,
  3. customer_company FROM dbo.tbl_CS_ticketMaster
  4. </cfquery>
  5.  
  6. <cfoutput query="ticket">
  7. <a href="form/cticketpage1edit.cfm?pk_ticketID=#pk_ticketID#" target="_blank">#pk_ticketID#</a>
  8. </cfoutput>
the index page basically allows the user to choose which ticket he is editing.

When you click on the link (which displays the ticket number the user is chooseing) it takes you to page 1 of the form that shows you the title of the ticket and contact information. When you click submit on the first page of the form it then takes you to the second page of the form where you see the contact information again (which it gets the contact information correctly) an then shows the serial and parts information (which is what i am trying to show). but reason we did it in 2 pages was because its a long form so didn't want to overwhelm the user.

Thank you,
Rach
Sep 24 '08 #12
acoder
16,027 Expert Mod 8TB
If you're not going to use the queries on page 1, there's no need for them there. On page 2, you will need to make the modifications that you've made in page 1.

Alternatively, keep everything in page 1 and show only parts and allow other parts to be shown using JavaScript.
Sep 24 '08 #13
bonneylake
769 512MB
If you're not going to use the queries on page 1, there's no need for them there. On page 2, you will need to make the modifications that you've made in page 1.

Alternatively, keep everything in page 1 and show only parts and allow other parts to be shown using JavaScript.
Hey Acoder,

ok i am a bit confused. so basically take out the serial and part table and move it onto the second page? i am just confused on what needs to stay and what needs to go.

Heres whats on page 1

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="ticket" datasource="CustomerSupport">
  2.         SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
  3.         customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,customer_state,
  4.         customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  5.         WHERE pk_ticketID = #URL.pk_ticketID#
  6. </cfquery>
  7.  
  8. <cfquery name="serial" datasource="CustomerSupport">
  9.         SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
  10.          verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
  11.           WHERE pkb_fk_ticketNo = #URL.pk_ticketID#
  12. </cfquery>
  13.  
  14. <cfquery name="parts" datasource="CustomerSupport">
  15.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
  16.          FROM dbo.tbl_CS_parts
  17.          WHERE fk_ticketNo = #URL.pk_ticketID#
  18. </cfquery>
  19.  
  20. <cfquery name="parts" datasource="CustomerSupport">
  21.         SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
  22.          FROM dbo.tbl_CS_parts
  23. </cfquery>
  24. <cfoutput>
  25. <form name="page1" id="page1" action="saveticket1edit.cfm?pk_ticketID=#pk_ticketID#"
  26. method="POST" onSubmit="return validate_form();">
  27. </cfoutput>
Thank you,
Rach
Sep 24 '08 #14
acoder
16,027 Expert Mod 8TB
You can remove those queries from page 1 and put them in page 2.
Sep 24 '08 #15
bonneylake
769 512MB
You can remove those queries from page 1 and put them in page 2.
Hey Acoder,

Wow can't believe it was so simple! THANK YOU THANK YOU, YOUR AWESOME!!! If you don't mind me asking just one more question. Ok i been running into a problem where if someone does not fill out a field it doesn't show the field at all. It will show the name next to the field, but the field itself no an was wondering how would i make the field still show up even with a value applied to the field.

Example
Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="serialnum_' + count + '" value="#pka_serialNo#">
I have tried
Expand|Select|Wrap|Line Numbers
  1. <cfparam name="Form.pka_serialNo" default="">
but because i have a value applied to it, it don't work so was wondering if there was a work around.

Thank you again,
Rach
Sep 24 '08 #16
acoder
16,027 Expert Mod 8TB
The user wouldn't be entering the pk_serialno value, would they? Is pka_serialNo a query value or a form variable?
Sep 24 '08 #17
bonneylake
769 512MB
The user wouldn't be entering the pk_serialno value, would they? Is pka_serialNo a query value or a form variable?
Hey Acoder,

the pka_serialNo is the query value. I tried to put the serialnum_ as the name but ran into trouble with that as well.

Thank you,
Rach
Sep 24 '08 #18
acoder
16,027 Expert Mod 8TB
Can you show the rest of the code that displays the query data?
Sep 24 '08 #19
bonneylake
769 512MB
Can you show the rest of the code that displays the query data?
Hey Acoder,

Its the same code i been showing you in the how to loop through this post. What happens is basically i have one record where someone didn't enter anything in the serial table or parts table an basically the serial table don't show up and some parts of the parts table shows up. An although nothing was entered in either it still needs to show up the field as blank (like if you click on add serial it shows all the fields blank). However, it instead just shows nothing. Here is what i have

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

Yeah i was going to ask you about the count towards the end, but probably should of asked that earlier. But that still didn't solve the problem. here is what i have

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

Bit confused on what you mean with the recordcount? are you meaning to do something like

Expand|Select|Wrap|Line Numbers
  1. <cfparam name="Form.recordcount" default="">
Thank you,
Rach
Sep 25 '08 #24
acoder
16,027 Expert Mod 8TB
No, the recordcount of the serial query, i.e. check serial.recordcount is 0.
Sep 25 '08 #25
bonneylake
769 512MB
No, the recordcount of the serial query, i.e. check serial.recordcount is 0.
Hey Acoder,

so like this
Expand|Select|Wrap|Line Numbers
  1. <cfparam name="serial.recordcount" default="0">
or does it need to be somewhere else?

Thank you,
Rach
Sep 25 '08 #26
acoder
16,027 Expert Mod 8TB
You don't need to use cfparam. Use cfif to check the query recordcount.
Sep 25 '08 #27
bonneylake
769 512MB
You don't need to use cfparam. Use cfif to check the query recordcount.
Hey Acoder,

so something like this
Expand|Select|Wrap|Line Numbers
  1. <cfif serial.recordcount is 0/>
an does it need to be up with the cfparam or does it need to be somewhere else?

Thank you,
Rach
Sep 25 '08 #28
acoder
16,027 Expert Mod 8TB
Don't close it with / - close with a </cfif>

Put it wherever you want to display the empty fields (obviously including the HTML within the tags).
Sep 25 '08 #29
bonneylake
769 512MB
Don't close it with / - close with a </cfif>

Put it wherever you want to display the empty fields (obviously including the HTML within the tags).
Hey Acoder,

its still not working. An i have also noticed that if i try to click add serial it gives me an error an it takes me to this line in the javascript

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

Well i am sadly still having problems. For some reason when i fixed the ending div tag to be outside the cfoutput it now has the parts part of my table working (its below this part in another table), before it would not even display those fields as having nothing applied to them, but for some reason the table don't wanna look right for it. But anyway so are you saying to wrap the html in the cfif for example

Expand|Select|Wrap|Line Numbers
  1. <cfif serial.recordcount is 0>
  2. <table class="zpExpandedTable" id="modeltable"> 
  3. <th class="sectiontitletick" colspan="7">
  4. Serial Information #count# </th>
  5. <tr>
  6. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  7. </td>
  8. <td>
  9. <select name="modelno_#count#">
  10. <option value="">Make A Selection</option>
  11. <cfloop query="models">
  12. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  13. </cfloop> 
  14. </select>
  15. </td>
  16. </tr>
  17. </table>
  18. </cfif>
i been trying this an it doesn't seem to do anything to it. An i don't know if this helps but if i try to click on add serial it says object required.

Thank you,
Rach
Sep 26 '08 #32
acoder
16,027 Expert Mod 8TB
What I was suggesting was to put the HTML for the blank fields in the cfif, e.g.
Expand|Select|Wrap|Line Numbers
  1. <!--- code that displays in loop for serials and parts --->
  2. <!--- ... --->
  3. <!--- now if no serials, then display empty table --->
  4. <cfif serial.recordcount is 0>
  5. <table class="zpExpandedTable" id="modeltable">
  6. <th class="sectiontitletick" colspan="7">
  7. Serial Information 1 </th>
  8. <tr>
  9. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  10. </td>
  11. <td>
  12. <select name="modelno_1">
  13. <option value="">Make A Selection</option>
  14. <cfloop query="models">
  15. <option value="#model#">#model#</option>
  16. </cfloop>
  17. </select>
  18. </td>
  19. </tr>
  20. </table>
  21. </cfif>
Sep 26 '08 #33
bonneylake
769 512MB
What I was suggesting was to put the HTML for the blank fields in the cfif, e.g.
Expand|Select|Wrap|Line Numbers
  1. <!--- code that displays in loop for serials and parts --->
  2. <!--- ... --->
  3. <!--- now if no serials, then display empty table --->
  4. <cfif serial.recordcount is 0>
  5. <table class="zpExpandedTable" id="modeltable">
  6. <th class="sectiontitletick" colspan="7">
  7. Serial Information 1 </th>
  8. <tr>
  9. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  10. </td>
  11. <td>
  12. <select name="modelno_1">
  13. <option value="">Make A Selection</option>
  14. <cfloop query="models">
  15. <option value="#model#">#model#</option>
  16. </cfloop>
  17. </select>
  18. </td>
  19. </tr>
  20. </table>
  21. </cfif>
Hey Acoder,

Hate to say it i am still confused. By looking at your example your implying to change modelno_#count# to modelno_1 an the thing is i still need the count there because it will have to be able to display previously entered records and also fields that they did not enter. an confused by also taking out the selected since i need the selected to show what the user selected as there option. But here is what i have. Now the add serial works correctly with no problems :). But here is what i have, bolded what is new.

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

However, before going any further, can you confirm that you definitely need to have something displayed for serials and parts even if there are none for a particular ticket?
Sep 26 '08 #35
bonneylake
769 512MB
I didn't mean to replace what you currently had, but to add to it.

However, before going any further, can you confirm that you definitely need to have something displayed for serials and parts even if there are none for a particular ticket?
Hey Acoder,

its ok about the replacing just making sure i can still keep it in there :).

But yes i definitely have to have something display there for serial an parts even if there was nothing applied to it to begin with. Need it because they might need to later add on to the form and if the field is not available to type in then they can't add on to it.

Thank you,
Rach
Sep 26 '08 #36
acoder
16,027 Expert Mod 8TB
In that case, you need to keep what you had before (without the cfif) and then copy and add after <cfloop query="serial"> the <cfif recordcount ...> code. What this would do is show the previous serials if any and if none, it would display an empty table for the user to fill.
Sep 26 '08 #37
bonneylake
769 512MB
In that case, you need to keep what you had before (without the cfif) and then copy and add after <cfloop query="serial"> the <cfif recordcount ...> code. What this would do is show the previous serials if any and if none, it would display an empty table for the user to fill.

Hey Acoder

so your saying to do to every field this

Expand|Select|Wrap|Line Numbers
  1. <select name="modelno_#count#">
  2. <option value="">Make A Selection</option>
  3. <cfloop query="models"><cfif serial.recordcount is 0>
  4. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  5. </cfif>
  6. </cfloop> 
  7. </select>
or something else? but here is everything inside the div, haven't added the <cfif serial.recordcount is 0> to them all yet

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

I tried this but i know this aint right i guess i am just confused on where i should put it. bolded where i put them

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

did that. Do i need to put inbetween the cfif a copy of everything above it except make the fields not have a value? here is what i have. bolded where i added it.

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

Yeah i might do an include when its all done i got 1136 lines of code. If i could move the javascript into its own file it would help a lot but when i tried it ran into problems. But anyway here is what i did but still getting the same thing. heres everything between cfif

Expand|Select|Wrap|Line Numbers
  1. <cfif serial.recordcount is 0>  
  2. <cfset count = 0>
  3. <!---<cfif serial.recordcount is 0>--->
  4. <cfoutput query="serial">
  5. <cfset model_no = #model_no#>
  6. <cfset product_type = #product_type#>
  7. <cfset type_hardware_failure = #type_hardware_failure#>
  8. <cfset software_hardware = #software_hardware#>
  9. <cfset resolution_verified_by = #resolution_verified_by#>
  10. <cfset dept_responsibility = #dept_responsibility#>
  11. <cfset count = count + 1>
  12. <div id="dynamic#count#Input">
  13. <table class="zpExpandedTable" id="modeltable"> 
  14. <th class="sectiontitletick" colspan="7">
  15. Serial Information #count# </th>
  16. <tr>
  17. <td id="paddingformultitop">Model No:&nbsp;&nbsp;&nbsp;&nbsp;</td>
  18. </td>
  19. <td>
  20. <select name="modelno_#count#">
  21. <option value="">Make A Selection</option>
  22. <cfloop query="models">
  23. <option value="#model#"<cfif #model# is #model_no#>selected</cfif>>#model#</option>
  24.  
  25. </cfloop> 
  26. </select>
  27.  
  28. </td>
  29. <td>
  30. &nbsp;&nbsp;&nbsp;&nbsp;Product Type:
  31. </td>
  32. <td>
  33. <select name="producttype_#count#">
  34. <option value="" selected>No Choice</option>
  35. <cfloop query="getProdType">
  36. <option value="#pk_productType#"<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option> 
  37. </cfloop>
  38. </select>
  39. </td>
  40. <td class="red'">
  41. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type Of Hardware Failure*:
  42. </td>
  43. <td>
  44. <select name="hardwarefailure_#count#">
  45. <option value="" selected>Make A Selection</option>
  46. <cfloop query="getHardwareFail">
  47. <option value="#pk_hardwareFailure#"<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>
  48. </cfloop>
  49. </select>
  50. </td>
  51. </tr>
  52. <table>
  53.  
  54. <!--- Shows what was previously entered for Serial Number and Software/Hardware  --->
  55. <table class="zpExpandedTable" id="modeltable">
  56. <tr>
  57. <td id="paddingformultitop">
  58. Serial Number:&nbsp;&nbsp;
  59. <input type="text" name="serialnum_#count#" value="#pka_serialNo#">
  60. &nbsp;&nbsp;&nbsp;&nbsp;Software/Hardware:&nbsp;&nbsp;
  61. <select name="softhardware_#count#">
  62. <option value="" selected>No Choice</option>
  63. <cfloop query="getSoftHard">
  64. <option value="#pk_softwareHardware#"<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>
  65. </cfloop>
  66. </select>
  67. </td>
  68. </tr>
  69. </table>
  70.  
  71. <!--- Shows what was previously entered for Description ---> 
  72.  
  73. <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0">
  74. <tr>
  75. <td id="paddingformutli">
  76. Description:&nbsp;&nbsp;
  77. </td>
  78. <td class="descriptionmoveinmulti">
  79. ( You may enter up to 500 characters. )
  80. <br>
  81. <cfloop query="description"><textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="thedescription_#count#">#description#</textarea></cfloop> 
  82. </td>
  83. </tr>
  84. </table>
  85.  
  86. <!---Shows what was previously entered for Resolution  --->
  87.  
  88. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  89. <tr>
  90. <td id="paddingformutli">
  91. Resolution:&nbsp;&nbsp;
  92. </td>
  93. <td class="resolutionmoveinmulti">
  94. ( You may enter up to 500 characters. )
  95. <br>
  96. <textarea  maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="resolution_#count#">#resolution#</textarea>
  97. </td>
  98. </tr>
  99. </table>
  100.  
  101. <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by  --->
  102.  
  103. <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0">
  104. <tr>
  105. <td id="paddingformultitop">
  106. Resolution Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  107. </td>
  108. <td>
  109. <input type="text" name="resdate_#count#" value="#resolution_date#">&nbsp;&nbsp;
  110.  
  111. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  112. <!---<input type="checkbox" name="currentdateresol_' + count + '" onClick=resdate_" + count + ".value=fill_date()>--->
  113.  
  114. </td>
  115. <td>
  116. Resolution Verified as effective by:&nbsp;&nbsp;
  117. </td>
  118. <td>
  119. <select name="resvertified_#count#">
  120. <option value="" selected>Make A Selection</option>
  121. <cfloop query="gettech">
  122. <option value="#fname# #lname#"<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>
  123. </cfloop>
  124. </select>
  125. </td>
  126. </tr>
  127. </table>
  128. <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date)   --->
  129. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  130. <tr>
  131. <td id="paddingformultitop">
  132. Verification Date:&nbsp;(MM/DD/YYYY)&nbsp;&nbsp;
  133. </td>
  134. <td class="vertificationmoveinmulti">
  135. <input type="text" name="vertifidate_#count#" value="#verification_date#">&nbsp;&nbsp;
  136. &nbsp;&nbsp;&nbsp;&nbsp;Current Date:&nbsp;&nbsp;
  137. <!---<input type="checkbox" name="currentdatevert_' + count + '" onClick=vertifidate_" + count + ".value=fill_date()>--->
  138. </td>
  139. </tr>
  140. </table>
  141.  
  142. <!--- Shows what was previously entered for Dept/Vendor Responsibility  --->
  143. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  144. <tr>
  145. <td class="red" id="paddingformultitop">
  146. Dept/Vendor Responsibility*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  147. <select name="deptvendor_#count#">
  148. <option value="" selected>Make A Selection</option>
  149. <cfloop query="getDeptVendor">
  150. <option value="#pk_deptVendor#"<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>
  151. </cfloop>
  152. </select>
  153. </td>
  154. </tr>
  155. </table>
  156.  
  157. <!--- Shows what was previously entered for RMA Data Only  --->
  158. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  159. <tr>
  160. <td id="paddingformultitop">
  161. RMA Data Only:&nbsp;&nbsp;&nbsp;&nbsp;
  162. </td>
  163. <td class="rmanmoveinmulti">
  164. ( You may enter up to 500 characters. )
  165. <br/>
  166. <textarea maxlength="500" onkeyup="return ismaxlength(this)" onkeydown="return ismaxlength(this)" rows="4" cols="60" name="rma_#count#" >#rma_data#</textarea>
  167. </td>
  168. </tr>
  169. </table>
  170. <!---<input type="hidden" name="serialcount" value="#count#">--->
  171.  
  172. <!--- Adds Delete to every ticket  --->
  173. <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0">
  174. <tr>
  175. <td>
  176. <!---<input type="button" class="removeticket" value="Remove Serial &quot;'+count +'&quot;" onclick=\"removeElement(\'"+divIdName+"\')\">--->
  177. <input type="button" class="removeticket" value="Remove Serial #count#" onclick="removeElement('dynamic#count#Input')">
  178. </td>
  179. </tr>
  180. </table>
  181. </div>
  182. </cfoutput>
  183. <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" />
  184. </cfif>
Thank you,
Rach
Sep 26 '08 #44
acoder
16,027 Expert Mod 8TB
No, the cfif must be outside the cfoutput query unless this is copied code and the previous code is untouched in which case you need to remove all code which references the query and its fields because there are no records.

One possibility that might make sense here is to have one file which contains the table and you set the variables before you call the file. This would avoid this repetition in the code which feels wrong and looks ugly.

Note that Coldfusion generates the JavaScript, so you can't move that into its own file unless it's a Coldfusion file rather than a JavaScript one.
Sep 26 '08 #45
bonneylake
769 512MB
No, the cfif must be outside the cfoutput query unless this is copied code and the previous code is untouched in which case you need to remove all code which references the query and its fields because there are no records.

One possibility that might make sense here is to have one file which contains the table and you set the variables before you call the file. This would avoid this repetition in the code which feels wrong and looks ugly.

Note that Coldfusion generates the JavaScript, so you can't move that into its own file unless it's a Coldfusion file rather than a JavaScript one.
Hey Acoder,

Yes the previous code has been untouched (just copied everything from the previous into the cfif. But i got it to display with nothing applied to it. But i must admit i am now having the trouble i had with serial with my parts table. i thought solving serial would solve parts but didn't an having trouble with it (exact same trouble with displaying it with no value applied).

an since i am having the same trouble with parts like serial and i would really hate to have 2 sections of code repeated twice to do this so i was wondering how would i go about making the file which contains the table and set s the variables before calling the file?

but yeah i figured i couldn't move the javascript based on the fact that it uses html and coldfusion. I moved other parts of the form into there own table but was only able to do those because didn't need anything from the html or coldfusion.

Thank you,
Rach
Sep 26 '08 #46
acoder
16,027 Expert Mod 8TB
If the parts and serials tables are significantly different, you're going to have to create two files anyway. Set all the values before including the file (which you're doing now anyway) and set them to empty for the 0 recordcount part, e.g.
Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="serial">
  2. <!--- cfset statements --->
  3. <cfinclude ...>
  4. </cfoutput>
  5. <cfif serial.recordcount is 0>
  6. <!--- cfset statements similar to above but set to "" --->
  7. <cfinclude ...>
  8. </cfif>
Sep 27 '08 #47
bonneylake
769 512MB
Hey Acoder,

Ok well here is what i got. But i got one question, was i suppose to use the value i assigned to each field or use the field name? i used the value i gave each field for this because was not sure.

Expand|Select|Wrap|Line Numbers
  1. serial table
  2. <cfoutput query="serial">
  3. <cfset model_no = #model_no#>
  4. <cfset product_type = #product_type#>
  5. <cfset type_hardware_failure = #type_hardware_failure#>
  6. <cfset pka_serialNo = #pka_serialNo#>
  7. <cfset software_hardware = #software_hardware#>
  8. <cfset description = #description#>
  9. <cfset resolution = #resolution#>
  10. <cfset resolution_date = #resolution_date#>
  11. <cfset resolution_verified_by = #resolution_verified_by#>
  12. <cfset verification_date = #verification_date#>
  13. <cfset dept_responsibility = #dept_responsibility#>
  14. <cfset rma_data = #rma_data#>
  15. <cfinclude template="serialdisplay.cfm">
  16. </cfoutput>
  17. <cfif serial.recordcount is 0>
  18. <cfset model_no = "">
  19. <cfset product_type = "">
  20. <cfset type_hardware_failure = "">
  21. <cfset pka_serialNo = "">
  22. <cfset software_hardware = "">
  23. <cfset description = "">
  24. <cfset resolution = "">
  25. <cfset resolution_date = "">
  26. <cfset resolution_verified_by = "">
  27. <cfset verification_date = "">
  28. <cfset dept_responsibility = "">
  29. <cfset rma_data = "">
  30. </cfinclude>
  31. </cfif>
  32.  
  33. parts table
  34. <cfoutput query="parts">
  35. <cfset hc_partNo = #hc_partNo#>
  36. <cfset defective = #defective#>
  37. <cfset submission = #submission#>
  38. <cfinclude template="partsdisplay.cfm">
  39. </cfoutput>
  40. <cfif parts.recordcount is 0>
  41. <cfset hc_partNo = "">
  42. <cfset defective = "">
  43. <cfset submission = "">
  44. </cfinclude>
  45. </cfif>
Thank you,
Rach
Sep 29 '08 #48
acoder
16,027 Expert Mod 8TB
The cfinclude should be the same for when the record count is 0, not </cfinclude>

If the field names are the same, you can remove those declarations from inside the loop.

A thought occurred to me. Could you not have empty serial/part tables/fields regardless of whether there was 0 record count or not, i.e. an empty table always appears at the end? This would get rid of the need to check for 0 record count.
Sep 29 '08 #49
bonneylake
769 512MB
Hey Acoder,

well it doesn't always need a empty table at the end. Most of the time all of the fields should be filled in except a few. those few not filled in are the ones the person filling in the information has to wait on till the user there helping has there problem solved.But although i know most of the fields should be filled in, that might not always be the case which is why i am making sure all the fields can allow blanks in them. An i am afraid adding a table at the end of it all would confuse the users an they would think to delete it every time an we got some lazy people who would complain about having to do that.but here is what i got, whats the next step?

Expand|Select|Wrap|Line Numbers
  1. serial table
  2. <cfoutput query="serial">
  3. <cfset model_no = #model_no#>
  4. <cfset product_type = #product_type#>
  5. <cfset type_hardware_failure = #type_hardware_failure#>
  6. <cfset pka_serialNo = #pka_serialNo#>
  7. <cfset software_hardware = #software_hardware#>
  8. <cfset description = #description#>
  9. <cfset resolution = #resolution#>
  10. <cfset resolution_date = #resolution_date#>
  11. <cfset resolution_verified_by = #resolution_verified_by#>
  12. <cfset verification_date = #verification_date#>
  13. <cfset dept_responsibility = #dept_responsibility#>
  14. <cfset rma_data = #rma_data#>
  15. <cfinclude template="serialdisplay.cfm">
  16. </cfoutput>
  17. <cfif serial.recordcount is 0>
  18. <cfset model_no = "">
  19. <cfset product_type = "">
  20. <cfset type_hardware_failure = "">
  21. <cfset pka_serialNo = "">
  22. <cfset software_hardware = "">
  23. <cfset description = "">
  24. <cfset resolution = "">
  25. <cfset resolution_date = "">
  26. <cfset resolution_verified_by = "">
  27. <cfset verification_date = "">
  28. <cfset dept_responsibility = "">
  29. <cfset rma_data = "">
  30. <cfinclude>
  31. </cfif>
  32.  
  33.  
  34. parts table
  35. <cfoutput query="parts">
  36. <cfset hc_partNo = #hc_partNo#>
  37. <cfset defective = #defective#>
  38. <cfset submission = #submission#>
  39. <cfinclude template="partsdisplay.cfm">
  40. </cfoutput>
  41. <cfif parts.recordcount is 0>
  42. <cfset hc_partNo = "">
  43. <cfset defective = "">
  44. <cfset submission = "">
  45. <cfinclude>
  46. </cfif>
Thank you :),
Rach
Sep 29 '08 #50

Post your reply

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

Similar topics

3 posts views Thread by Michael | last post: by
2 posts views Thread by Fred Flintstone | last post: by
5 posts views Thread by rn5a | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.