Originally posted by acoder
I am an idiot! I figured it out. I was messing around with stuff yesterday an i realized that i had somehow deleted the serialcount from my div (not sure how). But anyway it works like it suppose to it deletes the description when i delete the serial so i am SOOOO SORRY for the last however many posts related to this problem :(. But If you wouldnt mind just 2 more quick questions i would really really appreciate it :).
I was wondering how i could make it where if someone didn't fill out the description field it would not insert a row into the table? Right now no matter what it will still insert something for description even if i don't write a description.I was able to make it where if any of the fields for serial was not filled out it would not insert a row by using the following <cfparam name="Form.seri alcount" default=""> but not sure how i could do description. here is what i am using for description
Code:
<cfquery name="description" datasource="CustomerSupport"> exec usp_CS_Insertdescription <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.ID#', <cfqueryparam value="#thedescription#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.fk_addedBy#' </cfquery>
Code:
<!---IF HAVE ANY BLANKS IN ANY FIELDS THIS MAKES IT SO THE FIELD WILL SHOW UP---> <cfif serial.recordcount is 0> <!---<cfset count = 0>---> <cfset count = count + 1> <cfoutput> <div id="dynamic#count#Input"> <table class="zpExpandedTable" id="modeltable"> <th class="sectiontitletick" colspan="7"> Serial Information #count# </th> <tr> <td id="paddingformultitop">Model No: </td> </td> <td> <select name="modelno_#count#"> <option value="">Make A Selection</option> <cfloop query="models"> <option value="#model#">#model#</option> </cfloop> </select> </td> <td> Product Type: </td> <td> <select name="producttype_#count#"> <option value="" selected>No Choice</option> <cfloop query="getProdType"> <option value="#pk_productType#">#pk_productType#</option> </cfloop> </select> </td> <td class="red'"> Type Of Hardware Failure*: </td> <td> <select name="hardwarefailure_#count#"> <option value="" selected>Make A Selection</option> <cfloop query="getHardwareFail"> <option value="#pk_hardwareFailure#">#pk_hardwareFailure#</option> </cfloop> </select> </td> </tr> <table> <!--- Shows what was previously entered for Serial Number and Software/Hardware ---> <table class="zpExpandedTable" id="modeltable"> <tr> <td id="paddingformultitop"> Serial Number: <input type="text" name="serialnum_#count#" value=""> Software/Hardware: <select name="softhardware_#count#"> <option value="" selected>No Choice</option> <cfloop query="getSoftHard"> <option value="#pk_softwareHardware#">#pk_softwareHardware#</option> </cfloop> </select> </td> </tr> </table> <!--- Shows what was previously entered for Description ---> <table class="zpExpandedTable" id="resoltable" cellpadding="3" cellspacing="0"> <tr> <td id="paddingformutli"> Description: </td> <td class="descriptionmoveinmulti"> ( You may enter up to 1000 characters. ) <br> <textarea maxlength='1000' onkeyup='return descriptionmaxlength(this)' onkeydown='return descriptionmaxlength(this)'rows='4' cols='60' name="thedescription_#count#"></textarea> </td> </tr> </table> <!---Shows what was previously entered for Resolution ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td id="paddingformutli"> Resolution: </td> <td class="resolutionmoveinmulti"> ( You may enter up to 1500 characters. ) <br> <textarea maxlength='1500' onkeyup='return resolutionmaxlength(this)' onkeydown='return resolutionmaxlength(this)' rows='4' cols='60' name="resolution_#count#"></textarea> </td> </tr> </table> <!--- Shows what was previously entered for Resolution Date, Current Date (for resolution date) and resolution vertified as effective by ---> <table class="zpExpandedTable" id="resoldatetab" cellpadding="1" cellspacing="0"> <tr> <td id="paddingformultitop"> Resolution Date: (MM/DD/YYYY) </td> <td> <input type="text" name="resdate_#count#" value=""> 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> <cfloop query="gettech"> <option value="#fname# #lname#">#fname# #lname#</option> </cfloop> </select> </td> </tr> </table> <!--- Shows what was previously entered for Vertification Date, Current Date (for vertification date) ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td id="paddingformultitop"> Verification Date: (MM/DD/YYYY) </td> <td class="vertificationmoveinmulti"> <input type="text" name="vertifidate_#count#" value=""> Current Date: <input type="checkbox" name="currentdatevert_#count#" onClick="vertifidate_#count#.value=fill_date()"> </td> </tr> </table> <!--- Shows what was previously entered for Dept/Vendor Responsibility ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td class="red" id="paddingformultitop"> Dept/Vendor Responsibility*: <select name="deptvendor_#count#"> <option value="" selected>Make A Selection</option> <cfloop query="getDeptVendor"> <option value="#pk_deptVendor#">#pk_deptVendor#</option> </cfloop> </select> </td> </tr> </table> <input type="hidden" name="serialcount" value="#count#"> <!--- Adds Delete to every ticket ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td> <input type="button" class="removeticket" value="Remove Serial #count#" onClick="removeElement('dynamic#count#Input')"> </td> </tr> <tr> <td> <input type="button" class="addticket" value="Add Parts" onclick= "addpartInput('dynamic#count#Input')"> </td> </tr> </table> <cfset count1 = 0> <cfif parts.recordcount is 0> <cfset count1 = count1 + 1> <div id="part#count1#Name#count#"> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <th class="sectiontitle" colspan="7">Parts Information #count1# Serial Information #count#</th> <tr> <td class='indent' id='formfieldpadding'>HC P/N: <input type='text' name="hcpn_#count1#_#count#" style="margin:0px" value=""></td> <td> Parts been returned* <input type="checkbox" name="partsreturn_#count1#_#count#" value=""<cfif #part_returned# eq "1">checked=yes</cfif>/> </td> <td> <td class="indent">Defective<input type="checkbox" name="defective_#count1#_#count#" value=""<cfif #defective# eq "1">checked=yes</cfif>/></td> </td> </tr> </table> <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"> <!--- Shows what was previously entered for RMA Data Only ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td id="paddingformultitop"> RMA Data Only: </td> <td class="rmanmoveinmulti"> ( You may enter up to 1000 characters. ) <br/> <textarea maxlength="1000" onKeyUp="return rmaismaxlength(this)" onKeyDown="return rmaismaxlength(this)" rows="4" cols="60" name="rma_#count1#_#count#" ></textarea> </td> </tr> </table> <!--- Adds Delete to every ticket ---> <table class="zpExpandedTable" id="resoltable" cellpadding="1" cellspacing="0"> <tr> <td> <input type="button" class="removeticket" value="Remove Parts #count1#" onclick="removetheElement('part#count1#Name#count#')"></a> </td> </td> </tr> </table> <input type="hidden" name="partscount#count#" id="partscount#count#" value="#count1#"/> </div> </cfif> <input type="hidden" name="partcounter#count#" id="partcounter#count#" value="#count1#" /> </div> </cfoutput> <input type="hidden" value="<cfoutput>#count#</cfoutput>" name="theValue" id="theValue" /> </cfif>
Rach
Comment