What i am trying to do is show previously entered information. I know i need a loop for this , but i am not sure how to loop through this based on my form appears all in the javascript
here is my code
Expand|Select|Wrap|Line Numbers
- <cfquery name="serial" datasource="CustomerSupport">
- SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,resolution_date,
- verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_verified_by FROM dbo.tbl_CS_serial
- </cfquery>
- <cfoutput query="serial">
- <cfset model_no = #model_no#>
- <cfset product_type = #product_type#>
- <cfset type_hardware_failure = #type_hardware_failure#>
- <cfset software_hardware = #software_hardware#>
- <cfset resolution_verified_by = #resolution_verified_by#>
- <cfset dept_responsibility = #dept_responsibility#>
- </cfoutput>
- <script type="text/javascript">
- <!---Allows us to show previous fields --->
- function showInput(divName){
- var dynamic = document.getElementById('dynamicInput');
- var thevalue = document.getElementById('theValue');
- var count = (document.getElementById('theValue').value -1)+ 2;
- thevalue.value = count;
- var newdiv = document.createElement('div');
- var divIdName = 'dynamic'+count+'Input';
- newdiv.setAttribute('id',divIdName);
- <!--- Adds Extra fields for Model No, Product Type, and Type of Hardware Failure --->
- newdiv.innerHTML =
- "<table class='zpExpandedTable' id='modeltable'>" +
- "<th class='sectiontitletick' colspan='7'>Serial Information "+ count +" </th>" +
- "<tr>" +
- "<td id='paddingformultitop'>Model No: </td>" +
- "</td>" +
- "<td>" +
- "<select name='modelno_" + count + "'>" +
- "<option value=''>Make A Selection</option>" +
- "<cfoutput query='models'>" +
- "<option value='#model#'<cfif #model# is #evaluate(model_no)#>selected</cfif>>#model#</option>" +
- "</cfoutput>" +
- "</select>" +
- "</td>" +
- "<td>" +
- " Product Type:" +
- "</td>" +
- "<td>" +
- "<select name='producttype_" + count + "'>" +
- "<option value='' selected>No Choice</option>" +
- "<cfoutput query='getProdType'>" +
- "<option value='#pk_productType#'<cfif #pk_productType# is #product_type#>selected</cfif>>#pk_productType#</option>" +
- "</cfoutput>" +
- "</select>" +
- "</td>" +
- "<td class='red'>" +
- " Type Of Hardware Failure*:" +
- "</td>" +
- "<td>" +
- "<select name='hardwarefailure_" + count + "'>" +
- "<option value='' selected>Make A Selection</option>" +
- "<cfoutput query='getHardwareFail'>" +
- "<option value='#pk_hardwareFailure#'<cfif #pk_hardwareFailure# is #type_hardware_failure#>selected</cfif>>#pk_hardwareFailure#</option>" +
- "</cfoutput>" +
- "</select>" +
- "</td>" +
- "</tr>" +
- "<table>";
- <!--- Adds Extra fields for Serial Number and Software/Hardware --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='modeltable'>" +
- "<tr>" +
- "<td id='paddingformultitop'>" +
- "Serial Number: " +
- "<cfoutput query="serial"><input type='text' name='serialnum_" + count + "' value='#pka_serialNo#' ></cfoutput>" +
- " Software/Hardware: " +
- "<select name='softhardware_" + count + "'>" +
- "<option value='' selected>No Choice</option>" +
- "<cfoutput query='getSoftHard'>" +
- "<option value='#pk_softwareHardware#'<cfif #pk_softwareHardware# is #software_hardware#>selected</cfif>>#pk_softwareHardware#</option>" +
- "</cfoutput>" +
- "</select>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for Description --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='3' cellspacing='0'>" +
- "<tr>" +
- "<td id='paddingformutli'>" +
- "Description: " +
- "</td>" +
- "<td class='descriptionmoveinmulti'>" +
- "( You may enter up to 500 characters. )"+
- "<br>" +
- "<cfoutput query="description"><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)'rows='4' cols='60' name='thedescription_" + count + "'>#description#</textarea></cfoutput>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for Resolution --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td id='paddingformutli'>" +
- "Resolution: " +
- "</td>" +
- "<td class='resolutionmoveinmulti'>" +
- "( You may enter up to 500 characters. )"+
- "<br>" +
- "<cfoutput query='serial'><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='resolution_" + count + "'>#resolution#</textarea></cfoutput>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoldatetab' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td id='paddingformultitop'>" +
- "Resolution Date: (MM/DD/YYYY) " +
- "</td>" +
- "<td>" +
- "<cfoutput query='serial'><input type='text' name='resdate_" + count + "' value='#resolution_date#'> </cfoutput>" +
- " Current Date: " +
- "<input type='checkbox' name='currentdateresol_" + count + "' onClick=resdate_" + count + ".value=fill_date()>" +
- "</td>" +
- "<td>" +
- "Resolution Verified as effective by: " +
- "</td>" +
- "<td>" +
- "<select name='resvertified_" + count + "'>" +
- "<option value='' selected>Make A Selection</option>" +
- "<cfoutput query='gettech'>" +
- "<option value='#fname# #lname#'<cfif "#fname# #lname#" is #resolution_verified_by#>selected</cfif>>#fname# #lname#</option>" +
- " </cfoutput>" +
- "</select>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for Vertification Date, Current Date (for vertification date) --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td id='paddingformultitop'>" +
- "Verification Date: (MM/DD/YYYY) " +
- "</td>" +
- "<td class='vertificationmoveinmulti'>" +
- "<cfoutput query='serial'><input type='text' name='vertifidate_" + count + "' value='#verification_date#'> </cfoutput>" +
- " Current Date: " +
- "<input type='checkbox' name='currentdatevert_" + count + "' onClick=vertifidate_" + count + ".value=fill_date()>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for Dept/Vendor Responsibility --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td class='red' id='paddingformultitop'>" +
- "Dept/Vendor Responsibility*: " +
- "<select name='deptvendor_" + count + "'>" +
- "<option value='' selected>Make A Selection</option>" +
- "<cfoutput query='getDeptVendor'>" +
- "<option value='#pk_deptVendor#'<cfif #pk_deptVendor# is #dept_responsibility#>selected</cfif>>#pk_deptVendor#</option>" +
- " </cfoutput>" +
- "</select>" +
- "</td>" +
- "</tr>" +
- "</table>";
- <!--- Adds Extra fields for RMA Data Only --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td id='paddingformultitop'>" +
- "RMA Data Only: " +
- "</td>" +
- "<td class='rmanmoveinmulti'>" +
- "( You may enter up to 500 characters. )"+
- "<br/>" +
- "<cfoutput query='serial'><textarea maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows='4' cols='60' name='rma_" + count + "' >#rma_data#</textarea></cfoutput> " +
- "</td>" +
- "</tr>" +
- "</table>" +
- "<input type='hidden' name='serialcount' value='" + count + "'>";
- <!--- Adds Delete to every ticket --->
- newdiv.innerHTML = newdiv.innerHTML +
- "<table class='zpExpandedTable' id='resoltable' cellpadding='1' cellspacing='0'>" +
- "<tr>" +
- "<td>" +
- "<input type='button' class='removeticket' value='Remove Serial ""+count +""' onclick=\"removeElement(\'"+divIdName+"\')\"></a>" +
- "</td>" +
- "</td>" +
- "</tr>" +
- "</table><br>";
- document.getElementById(divName).appendChild(newdiv);
- }
- </script>
i was using this after i submitted my form to loop through it. it was used to submit the form fields and also show a print screen on what was previously entered.
Expand|Select|Wrap|Line Numbers
- <CFSET machineListLen = listLen(Form.serialcount)>
- <CFLOOP from="1" to="#machineListLen#" index="machineCount">
- <CFSET serialnum = "Form.serialnum_" & machineCount>
- <CFSET modelno = "Form.modelno_" & machineCount>
- <CFSET producttype = "Form.producttype_" & machineCount>
- <CFSET softhardware = "Form.softhardware_" & machineCount>
- <CFSET resolution = "Form.resolution_" & machineCount>
- <CFSET resdate = "Form.resdate_" & machineCount>
- <CFSET resvertified = "Form.resvertified_" & machineCount>
- <CFSET vertifidate = "Form.vertifidate_" & machineCount>
- <CFSET deptvendor = "Form.deptvendor_" & machinecount>
- <CFSET hardwarefailure = "Form.hardwarefailure_" & machineCount>
- <CFSET rma = "Form.rma_" & machineCount>
- <CFSET thedescription = "Form.thedescription_" & machineCount>
- #evaluate(modelno)#....an so on.
Thank you for all the help,
Rach