10 Replies - 1375 Views - Last Post: 14 September 2011 - 11:28 AM Rate Topic: -----

Topic Sponsor:

#1 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Submit button not bringing up next page 500 error

Posted 13 September 2011 - 12:23 PM

When I press the submit button on this page it doesn't bring up the next page. I apologise form the lack of comments but this code was given to me by my boss from some senior web developer here. The submit I'm talking about is on line 444 of cfc.cfm

cfc.cfm
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CFC 2011 Input Form</title>
<style type="text/css">
<!--
.style2 {
	font-size: 20px;
	font-weight: bold;


.style3 {
		font-size: 14px;
	font-weight: bold;
}
-->
</style>

<script>
function settotalgift() {
document.cfc.totalgift.value = document.cfc.civpayamt.value*26;
document.cfc.totalgift.value = Math.round(document.cfc.totalgift.value*100);
document.cfc.totalgift.value = document.cfc.totalgift.value/100;
//alert("totalgift = " + document.cfc.totalgift.value );
}	
function setcivpayamt() {
document.cfc.civpayamt.value = document.cfc.totalgift.value/26;
document.cfc.civpayamt.value = Math.round(document.cfc.civpayamt.value*100);
document.cfc.civpayamt.value = document.cfc.civpayamt.value/100;
//alert("civpayamt = " + document.cfc.civpayamt.value );
}	
</script>	

</head>

<body>

<cfset CYear = #Year(Now())# >
<cfset CMonth = #Month(Now())# >
<cfif CMonth GTE 10 ><cfset CYear = #CYear# + 1 ></cfif>
<cfset Session.CYear = #CYear# > 
<!--- <cfoutput><br>Debug: 42 Year = #CYear#, Month = #CMonth# </cfoutput> --->
<cfset Comp = 0 >
<cfset Dup = 0 >

<CFIF Not IsDefined("process")>
<!---   <cfoutput><BR>Debug: 45 Process = undefined</cfoutput> <cfabort> --->
  <cfform action="cfc.cfm" method="post">
  
  <input type="hidden" name="Process" Value="1">

	<table width="800" border="0" align="left" bgcolor="#CCCCCC">
	 <cfoutput>
	<tr>
	    <td colspan="3"><span class="style2">CFC Campaign Input Form</span></td>
  </tr>
  <tr>
  	    <td width="147">&nbsp;</td>
  	    <td width="261">&nbsp;</td>
  	    <td width="325">&nbsp;</td>
	  </tr>
	  <tr>
	    <td colspan="3"><span class="style3">Please enter a valid ECI Number</span></td>
	  </tr>

	  <tr>
	    <td>ECI Number</td>
	    <td><input name="eci" type="text" id="eci" size="9" /></td>
	    <td>&nbsp;</td>
	  </tr>

	  <tr>
	    <td></td>
	    <td><input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" /></td>
	    <td>&nbsp;</td>
	  </tr>
	 </cfoutput>
    </table>
	<BR clear="all" >
 </cfform>

<CFELSE>
<!---   <cfoutput><BR>Debug: 81 Process = defined</cfoutput> <cfabort> --->
<cfoutput>
<cfquery name="qVerify" <!---datasource="dcshalts_01"---> datasource="DCSbsb">
    SELECT             eci, cfc_comp, lname, fname, mname, email
    FROM               eci
    WHERE              eci = '#eci#'
</cfquery>
</cfoutput>
<cfset Session.email = qVerify.email[1] >

<!--- <cfoutput><br>Debug: 91 Was as Organization ECI was found with "f" or "F" as an ECI. </cfoutput> --->
<cfset Org = 0 >
<!--- <cfoutput><br>Debug: 93 Organization ECI = #ECI#, #Left(eci,1)#. </cfoutput> <Cfabort> --->
<cfif Left(eci,1) EQ "f" OR Left(eci,1) EQ "F" > 
<!---   <cfoutput><br>Debug: 94 Organization ECI was found with "f" or "F" as an ECI. </cfoutput>  --->
  <cfset Org = 1 >
  <!--- <br>Debug: 89 were any other Organization records found with "f" or "F" as an ECI. --->
  <cfquery name="qVerifyF" <!---datasource="dcshalts_01"---> datasource="DCSbsb">
    SELECT             eci, cfc_comp, lname, fname, mname, email
    FROM               cfc
    WHERE              (eci Like 'F%') OR (eci Like 'f%')
  </cfquery>
<cfset ecix = #eci# >
<!--- <cfoutput><br>Debug: 105 Organization CFC Records found (with "f" or "F" as an ECI) = #qVerifyF.RecordCount#. </cfoutput> --->
<cfloop query="qVerifyF" >
<!--- <cfoutput><br>debug: 107 eci = #ecix#, qVerifyF.eci = #qVerifyF.eci#, Component = #qVerifyF.cfc_comp#</cfoutput> --->
  <cfif ecix EQ qVerifyF.eci >
    <cfset Dup = 1 >
	<cfset Comp = #qVerifyF.cfc_comp# >
	<cfbreak>
<!---  <cfoutput><br>debug: 110 eci = #qVerifyF.eci#</cfoutput> <cfabort> --->
  </cfif>
</cfloop>

<!--- <cfoutput><br>debug: 114 after duplicate F eci check. </cfoutput> --->
<cfif Dup NEQ 1 >
<cfset Max = 0 >
<cfif qVerifyF.RecordCount GTE 1 >
  <cfset Max = #qVerifyF.RecordCount# >
<!---   <cfoutput><br>debug: 101 Max = #Max# </cfoutput> --->
  <cfset MAX = #Max# + 1 >
  <cfif Max LT 10 >    <cfset eci = 'F00000000'&'#MAX#' >
  <cfelseif Max LT 100 ><cfset eci = 'F0000000'&'#MAX#' >
  <cfelseif Max LT 1000 ><cfset eci = 'F000000'&'#MAX#' > 
  <cfelseif Max LT 10000 ><cfset eci = 'F00000'&'#MAX#' >   
  <cfelseif Max LT 100000 ><cfset eci = 'F0000'&'#MAX#' > 
  <cfelseif Max LT 1000000 ><cfset eci = 'F000'&'#MAX#' > 
  </cfif>  
<cfelse>
<!---   <cfoutput><br>debug: 129 Max = #Max# </cfoutput> --->
  <cfset eci = 'F00000000'&'1' >
</cfif>
</cfif>

<!---   <cfoutput><br>Debug: 134  ECI = #eci#. </cfoutput>       --->
</cfif>
<cfset Session.Org = #Org# >

<!--- Was this ECI used previously to store a record in the database? --->
<cfquery name="getcfcuser" <!---datasource="dcshalts_01"---> datasource="DCSbsb">
select *
from cfc
where eci='#eci#'
</cfquery>
<cfset Dup = 0 >
<cfif getcfcuser.RecordCount gt 0 >
<!--- <cfoutput><br>Debug: Duplicate eci record found in database with #getcfcuser.RecordCount# --->
<cfset Dup = 1 >
<!--- <cfset recd = 0 > --->
<!--- <cfloop query="getcfcuser" > --->
<!---   <cfset recd = #recd# + 1 > --->
<!---    <br>#recd# ECI = #eci#, Last Name, #lname#, First Name, #fname#, bi-weekly payroll = #totalgift# --->
<!--- </cfloop> --->
<!--- </cfoutput> --->
</cfif>
<cfset Session.Dup = #Dup# >
<!--- INSERT INTO cfc (eci,lname,fname,mname,civpayamt,totalgift,chkcashamt,chknumber,date_contrib,street,city,state,zip,email,inserttimestamp --->

<!--- <cfoutput><br>Debug: 110 qVerify.RecordCount = #qVerify.RecordCount#. </cfoutput> --->
<!--- <cfif Org EQ 1 ><cfset qVerify.RecordCount = 1 ></cfif> --->
<!--- <cfif qVerify.RecordCount GT 0 >
  <cfoutput><br>Debug: 113 eci Records found = #qVerify.RecordCount# </cfoutput>
<cfelse>
  <br>Debug 115 No ECI records found.  
</cfif> --->

<!--- <cfoutput><br>Debug: 163 cfc.cfm Records found = #qVerify.RecordCount#, eci = #qVerify.eci[1]# </cfoutput>  <cfabort> --->
<cfif qVerify.RecordCount OR Org EQ 1 OR Dup EQ 1 >

<!--- <cfoutput><br>Debug: 154 cfc.cfm Records found = #qVerify.RecordCount#, eci = #qVerify.eci[1]# </cfoutput> --->

		<cfform name="cfc" action="cfc_insert.cfm" method="post">
		<table width="815" border="0" align="left" bgcolor="#CCCCCC">
		  <tr>
			<td colspan="3"><span class="style2">CFC Campaign Input Form for <cfoutput>#CYear#</cfoutput></span></td>
		  </tr>
		  <tr>
			<td width="350">&nbsp;</td>					<!--- 147 --->
			<td width="261">&nbsp;</td>
			<td width="325">&nbsp;</td>
		  </tr>
<!--- <cfoutput><br>Debug: 181 eci Records found = #qVerify.RecordCount#, eci = #eci#, Component = #Comp# </cfoutput> --->
	<cfif qVerify.RecordCount GT 0 >

		<CFOUTPUT Query="qVerify">
		  <!--- <cfoutput><br>debug: 188 mname = #getcfcuser.mname[1]#, fname= #fname#,  Org = #Org#, Dup = #Dup# </cfoutput> --->
		  <tr>
			<td>ECI</td>
			<td><input name="eci" type="text" id="eci" size="9" value=#eci# ></td>
			<td>&nbsp;</td>
		  </tr>
	  	  <tr>
			<td>Component</td>
			<td><input name="cfc_comp" type="text" id="cfc_comp" size="40" value= #cfc_comp# 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.cfc_comp[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>		  
		  <tr>
			<td>Last Name</td>
			<td><input name="lname" type="text" id="lname" size="40" value= #lname# 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.lname[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>First Name</td>
			<td><input name="fname" type="text" id="fname" size="30" value= #fname# 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.fname[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>Middle Name/Initial</td>
			<td><input name="mname" type="text" id="mname" size="30" value= #mname# 
			<cfif Dup EQ 1 AND getcfcuser.mname[1] NEQ "" >value=<cfoutput>"#getcfcuser.mname[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>		  
		</CFOUTPUT>
		
		<cfelse>
		  <!--- <cfoutput><br>debug: 220 mname = #getcfcuser.mname[1]# Org = #Org#, Dup = #Dup# </cfoutput> --->
		  <tr>
			<td>ECI</td>
			<td><input name="eci" type="text" id="eci" size="9" 
			<cfoutput><cfif Org EQ 1>value=#eci#<cfelse> value=#eci#</cfif> ></td> </cfoutput>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>Component</td>
			<cfoutput><td><input name="cfc_comp" type="text" id="cfc_comp" size="40" <!--- value= #cfc_comp# ---> 
			<cfif Org EQ 1 AND Dup NEQ 1 >value="" <cfelseif Dup EQ 1 >value=<cfoutput>"#getcfcuser.cfc_comp[1]#"</cfoutput></cfif>></td> </cfoutput>
			<td>&nbsp;</td>
		  </tr>		  
		  <tr>
			<td>Last Name</td>
			<cfoutput><td><input name="lname" type="text" id="lname" size="40" <!--- value= #lname# ---> 
			<cfif Org EQ 1>value="CFC Fund Raiser" <cfelseif Dup EQ 1 >value=<cfoutput>"#getcfcuser.lname[1]#"</cfoutput></cfif>></td> </cfoutput>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>First Name</td>
			<cfoutput><td><input name="fname" type="text" id="fname" size="30" <!--- value= #fname# ---> 
			<cfif Org EQ 1 AND Dup NEQ 1 >value=""     <cfelseif Dup EQ 1 >value=<cfoutput>"#getcfcuser.fname[1]#"</cfoutput></cfif>></td> </cfoutput>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>Middle Name/Initial</td>
			<cfoutput><td><input name="mname" type="text" id="mname"  size="30" <!--- value= #mname# --->
			<cfif Org EQ 1 AND Dup NEQ 1 >value=""     <cfelseif Dup EQ 1 >value=<cfoutput>"#getcfcuser.mname[1]#"</cfoutput></cfif>></td> </cfoutput>			
			<!--- <cfif Dup EQ 1 >value="" <cfoutput>"#getcfcuser.mname[1]#"</cfoutput></cfif>></td> --->
			<td>&nbsp;</td>
		  </tr>		
		</cfif>		  
		
		  
		  <tr>
			<td>Bi-weekly Payroll Deduction <!--- Civilian Payroll ---> $</td>
			<td><input type="text" name="civpayamt" size="10" id="civpayamt" onchange="settotalgift()"
			<cfif Org EQ 1 >readonly=""</cfif> 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.civpayamt[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>
		  
		  <tr>
			<td>Total Annual Payroll Deduction <!--- Total Gift ---> $</td>
			<td><input name="totalgift" type="text" id="totalgift" size="10" onchange="setcivpayamt()" readonly="" 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.totalgift[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>
		  
		  <tr>
			<td>Check /Cash Amt. $</td>
			<td><input type="text" name="chkcashamt" id="chkcashamt" 
			<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.chkcashamt[1]#"</cfoutput></cfif>></td>
			<td>&nbsp;</td>
		  </tr>
		  
<!--- 		  <tr>
				<td>Check Number</td>
				<td><input type="text" name="chknumber" id="chknumber" 
				<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.chknumber[1]#"</cfoutput></cfif>></td>
				<td>&nbsp;</td>
		  </tr> --->

<!--- 		  <tr>
			<td>Date of Contribution</td>
			<td colspan="2"><!--- <input type="text" name="date_contrib" id="date_contrib" > --->
			  <cfoutput>#DateFormat(Now())#</cfoutput>
			  <!--- Date Format: (dd/mm/yyyy) ---></td>
		  </tr>

		   <tr>
		  			<td>Street Address</td>
		  			<td colspan="2"><input name="street" type="text" id="street" size="60" ></td>
		  		  </tr>
		  		  <tr>
		  			<td>City</td>
		  			<td colspan="2"><input name="city" type="text" id="city" size="50" ></td>
		  		  </tr>
		  		  <tr>
		  			<td>State</td>
		  			<td>
		  			<select
		  				  name="State" size="1">
		  					<option value="" selected>--- Select a State ---
		  										<option value="AL">AL - Alabama
												<option value="AK">AK - Alaska
												<option value="AZ">AZ - Arizona
												<option value="AR">AR - Arkansas
												<option value="CA">CA - California
												<option value="CO">CO - Colorado
												<option value="CT">CT - Connecticut
												<option value="DE">DE - Delaware
												<option value="DC">DC - District of Columbia
												<option value="FL">FL - Florida
												<option value="GA">GA - Georgia
												<option value="GU">GU - Guam
												<option value="HI">HI - Hawaii
												<option value="ID">ID - Idaho
												<option value="IL">IL - Illinois
												<option value="IN">IN - Indiana
												<option value="IA">IA - Iowa
												<option value="KS">KS - Kansas
												<option value="KY">KY - Kentucky
												<option value="LA">LA - Louisiana
												<option value="ME">ME - Maine
												<option value="MD">MD - Maryland
												<option value="MA ">MA - Massachusetts
												<option value="MI">MI - Michigan
												<option value="MN">MN - Minnesota
												<option value="MS">MS - Mississippi
												<option value="MO">MO - Missouri
												<option value="MT">MT - Montana
												<option value="NE">NE - Nebraska
												<option value="NV">NV - Nevada
												<option value="NH">NH - New Hampshire
												<option value="NJ">NJ - New Jersey
												<option value="NM">NM - New Mexico
												<option value="NY">NY - New York
												<option value="NC">NC - North Carolina
												<option value="ND">ND - North Dakota
												<option value="MP">MP - Northern Mariana Isles
												<option value="OH">OH - Ohio
												<option value="OK">OK - Oklahoma
												<option value="OR">OR - Oregon
												<option value="PW">PW - Palau Islands
												<option value="PA">PA - Pennsylvania
												<option value="PR">PR - Puerto Rico
												<option value="RI">RI - Rhode Island
												<option value="SC">SC - South Carolina
												<option value="SD">SD - South Dakota
												<option value="TN">TN - Tennessee
												<option value="TX">TX - Texas
												<option value="UT">UT - Utah
												<option value="VT">VT - Vermont
												<option value="VI">VI - Virgin Islands
												<option value="VA">VA - Virginia
												<option value="WA">WA - Washington
												<option value="WV">WV - West Virginia
												<option value="WI">WI - Wisconsin
												<option value="WY">WY - Wyoming
		  						</select>    </td>
		  			<td>&nbsp;</td>
		  		  </tr>
				  
		  		  <tr>
		  			<td>Zip Code</td>
		  			<td><input name="zip" type="text" id="zip" size="20" ></td>
		  			<td>&nbsp;</td>
		  		  </tr> --->
				  
<!--- 	  		     <tr>
		  			<td>Home Email Address</td>
		  			<td><input name="email" type="text" id="email" size="50" 
					<cfif Dup EQ 1 >value=<cfoutput>"#getcfcuser.email[1]#"</cfoutput><cfelse> value=<cfoutput>"#qverify.email[1]#"</cfoutput></cfif> ></td>
		  			<td>&nbsp;</td>
		  	     </tr> --->

		<cfset Chs = 40 >
<!--- 		<cfloop index="ch" from="1" to="#Chs#" >
			  <cfset code = "charity_code"&"#ch#" >
			  <cfset amt  = "charity_code"&"#ch#"&"_amt" >
		 <cfoutput>
<!--- 			  <br>debug code name = #code#, amount name = #amt# --->
		  <tr>
			<td>Charity Code #ch#</td>
			<td colspan="2"><label>
			  <input name="#code#" type="text" id="#code#" size="5" maxlength="5" >
			  Annual Amount $
			  <input type="text" name="#amt#" id="#amt#" >
			</label></td>
		  </tr>	
		 </cfoutput>
		</cfloop> --->
		  
		  
<!--- 		  <tr>
			<td>Charity Code</td>
			<td colspan="2"><label>
			  <input name="charity_code1" type="text" id="charity_code1" size="5" maxlength="5" >
			  Annual Amount $
			  <input type="text" name="charity_code1_amt" id="charity_code1_amt" >
			</label></td>
		  </tr>
		  <tr>
			<td>Charity Code</td>
			<td colspan="2"><input name="charity_code2" type="text" id="charity_code2" size="5" maxlength="5" >
			  Annual Amount $
				<input type="text" name="charity_code2_amt" id="charity_code2_amt" ></td>
		  </tr>
		  <tr>
			<td>Charity Code</td>
			<td colspan="2"><input name="charity_code3" type="text" id="charity_code3" size="5" maxlength="5" >
			Annual Amount $
			<input type="text" name="charity_code3_amt" id="charity_code3_amt" ></td>
		  </tr>
		  <tr>
			<td>Charity Code</td>
			<td colspan="2"><input name="charity_code4" type="text" id="charity_code4" size="5" maxlength="5" >
			Annual Amount $
			<input type="text" name="charity_code4_amt" id="charity_code4_amt"></td>
		  </tr>
		  <tr>
			<td>Charity Code</td>
			<td colspan="2"><input name="charity_code5" type="text" id="charity_code5" size="5" maxlength="5" >
			   Annual Amount $
			   <input type="text" name="charity_code5_amt" id="charity_code5_amt" ></td>
		  </tr> --->

		  <tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		  </tr>
		  <tr> <td colspan="3"><div align="center"><input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" ></div></td></tr>
	
		</table>
		<cfset SESSION.ECI = Form.eci>
		</cfform>

		<br clear="all" >
		<cfform name="cfcexit" action="cfc.cfm" method="post" >
		  <cfset process = 0 >
		  <tr> <td colspan="3" align="center" >&nbsp;&nbsp;&nbsp;&nbsp;<div align="center"><input type="submit" name="Submit" id="Submit" value="Clear Screen" onclick="CFC.cfm" >
		          </div></td></tr>		  <!--- <a href="CFC.cfm">Clear Screen</a> --->
    	</cfform>


<cfelse>


       <script>
			alert("You entered an invalid ECI, please try again!!!");
			self.location="Javascript:history.go(-1)";
       </script>
</cfif>

</CFIF>


</body>

<cfloop 
list="session,variables,client,url,form,request,server,cgi" 
index="i">
    <cfdump var="#evaluate(i)#" label="#i#">
</cfloop>

</html>


cfm_insert

<html>
<head>


</head>


<cfset Chs = 40 >

<cfinclude template="validate.cfm" >

<cfif Session.Dup EQ 1 >
<cfquery name="updatecfcuser" <!---datasource="dcshalts_01"---> datasource="DCSbsb">
update cfc 
set lname='#form.lname#', fname='#form.fname#', mname='#form.mname#'
, cfc_comp='#form.cfc_comp#', year='#Session.CYear#'
, civpayamt='#form.civpayamt#', totalgift='#form.totalgift#', chkcashamt='#form.chkcashamt#'
where eci = '#SESSION.eci#'
</cfquery>


<cfelse>
<cfquery name="addcfcuser" <!---datasource="dcshalts_01"---> datasource="DCSbsb">
INSERT INTO cfc (eci,lname,fname,mname,civpayamt,totalgift,chkcashamt,year,cfc_comp<!--- ,chknumber,date_contrib, --->
<!--- street,city,state,zip, ---><!--- email, --->, inserttimestamp
		<!--- <cfloop index="ch" from="1" to="#Chs#">
		  <cfset code = "charity_code"&"#ch#" >
		  <cfset amt  = "charity_code"&"#ch#"&"_amt" >
		 <cfif ch NEQ Chs >
		  #code#, #amt#,
		 <cfelse>
		  #code#, #amt# 
		 </cfif>		  
		</cfloop> --->
<!--- charity_code1,charity_code2,charity_code3,
charity_code4, charity_code5,charity_code1_amt,charity_code2_amt,charity_code3_amt,charity_code4_amt,charity_code5_amt --->
)
VALUES (
'#Form.eci#',
'#Form.lname#',
'#Form.fname#',
'#Form.mname#',
'#Form.civpayamt#',
'#Form.totalgift#',
'#Form.chkcashamt#',
'#Session.CYear#',
'#cfc_comp#'
<!--- ,'#Form.chknumber#', --->
<!--- #Now()#,						<!--- '#Form.date_contrib#', ---> --->
<!--- '#Form.street#',
'#Form.city#',
'#Form.state#',
'#Form.zip#', --->
<!--- '#Form.email#', --->
getdate()
<!---        <cfloop index="ch" from="1" to="#Chs#">
		  <cfset code = "form.charity_code"&"#ch#" >
		  <cfset amt  = "form.charity_code"&"#ch#"&"_amt" >
		  <cfset ecode = #val(evaluate(code))# >
		  <cfset eamt  = #val(evaluate(amt))# >		  
		  ,'#ecode#','#eamt#'
	   </cfloop> --->
<!--- ,'#Form.charity_code1#', '#Form.charity_code1_amt#'
,'#Form.charity_code2#', '#Form.charity_code2_amt#'
,'#Form.charity_code3#', '#Form.charity_code3_amt#'
,'#Form.charity_code4#', '#Form.charity_code4_amt#'
,'#Form.charity_code5#', '#Form.charity_code5_amt#'
,'#Form.charity_code6#', '#Form.charity_code6_amt#'
,'#Form.charity_code7#', '#Form.charity_code7_amt#'
,'#Form.charity_code8#', '#Form.charity_code8_amt#'
,'#Form.charity_code9#', '#Form.charity_code9_amt#'
,'#Form.charity_code10#', '#Form.charity_code10_amt#'
,'#Form.charity_code11#', '#Form.charity_code11_amt#'
,'#Form.charity_code12#', '#Form.charity_code12_amt#'
,'#Form.charity_code13#', '#Form.charity_code13_amt#'
,'#Form.charity_code14#', '#Form.charity_code14_amt#'
,'#Form.charity_code15#', '#Form.charity_code15_amt#'
,'#Form.charity_code16#', '#Form.charity_code16_amt#'
,'#Form.charity_code17#', '#Form.charity_code17_amt#'
,'#Form.charity_code18#', '#Form.charity_code18_amt#'
,'#Form.charity_code19#', '#Form.charity_code19_amt#'
,'#Form.charity_code20#', '#Form.charity_code20_amt#'
,'#Form.charity_code21#', '#Form.charity_code21_amt#'
,'#Form.charity_code22#', '#Form.charity_code22_amt#'
,'#Form.charity_code23#', '#Form.charity_code23_amt#'
,'#Form.charity_code24#', '#Form.charity_code24_amt#'
,'#Form.charity_code25#', '#Form.charity_code25_amt#'
,'#Form.charity_code26#', '#Form.charity_code26_amt#'
,'#Form.charity_code27#', '#Form.charity_code27_amt#'
,'#Form.charity_code28#', '#Form.charity_code28_amt#'
,'#Form.charity_code29#', '#Form.charity_code29_amt#'
,'#Form.charity_code30#', '#Form.charity_code30_amt#'
,'#Form.charity_code31#', '#Form.charity_code31_amt#'
,'#Form.charity_code32#', '#Form.charity_code32_amt#'
,'#Form.charity_code33#', '#Form.charity_code33_amt#'
,'#Form.charity_code34#', '#Form.charity_code34_amt#'
,'#Form.charity_code35#', '#Form.charity_code35_amt#'
,'#Form.charity_code36#', '#Form.charity_code36_amt#'
,'#Form.charity_code37#', '#Form.charity_code37_amt#'
,'#Form.charity_code38#', '#Form.charity_code38_amt#'
,'#Form.charity_code39#', '#Form.charity_code39_amt#'
,'#Form.charity_code40#', '#Form.charity_code40_amt#' --->
)
</cfquery>

</cfif>   <!---  End if check for an updated record as opposed to a new record. --->

	<script>
			alert("You have successfully added <cfoutput>#Form.fname# #Form.lname#</cfoutput> to the database.");
			self.location="cfc.cfm";
	</script>

</html>




This post has been edited by maguscrowley: 13 September 2011 - 12:26 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Submit button not bringing up next page 500 error

#2 Craig328  Icon User is online

  • I make this look good
  • member icon

Reputation: 1101
  • View blog
  • Posts: 2,607
  • Joined: 13-January 08

Re: Submit button not bringing up next page 500 error

Posted 13 September 2011 - 12:38 PM

Hi again Magus. Listen, you can't post nearly 600 lines of code without a better explanation of what it is you are seeing. Not too many people are going to sift through that much unfamiliar code for you particularly when they have no idea what it's doing.

That said, the pertinent part of your code is narrowed down to this:
<cfform name="cfcexit" action="cfc.cfm" method="post" >
<cfset process = 0 >
<tr>
   <td colspan="3" align="center" >&nbsp;&nbsp;&nbsp;&nbsp;<div align="center">
   <input type="submit" name="Submit" id="Submit" value="Clear Screen" onclick="CFC.cfm" >
   </div>
   </td>
</tr>
</cfform>


What you have there is a CFFORM that should be submitting to itself (the action="cfc.cfm" part) but the submit button you have is also trying to do an onclick event that won't do anything (the onclick="CFC.cfm" part).

Try removing that onclick event as it could be causing the page to throw a Javascript error which could in turn be messing up your CFFORM submission.

If that doesn't fix it, give us a better idea of what the code IS doing. Clues man...you gots to give some clues.

Good luck!
Was This Post Helpful? 0
  • +
  • -

#3 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Re: Submit button not bringing up next page 500 error

Posted 13 September 2011 - 01:44 PM

OOps. It's actually the line 435 sumbit that won't work. Sorry.

The application is the one that the one I was working on before that I was asking help with. I was told to build this app from scratch knowing there was an old app in production and (with your help) was able to do that. Unfortunatly the CFC campaign starts this week and they need the old app working so they gave me the old code to fix up. They just wanted a simple timestamp. Turns out last year they didn't use the application. Good thing because when I got it and tested it yesterday I found out it didn't work anyway.

The app just has to take an ECI number which is the primary key in a horribly designed spreadsheet of a database fetch the their name, the amounts their contributing from their paycheck (civpayamt) and any check amount (chkcashamt) they're putting in on their own and calculate the total gift (totalgift) as dependent on the 26 pay periods and display that as total gift.

If that all looks right then it should be sumbitted and a nice little confirmation screen should come up.

The CFC campaign is the Combined Federal Campaign. Rather then soliciting federal employees through the year any charity that wants to campaign here has to register with the CFC and once a year a drive is held. Employees can have automated deductions from their paycheck or give a check. The Office of Personel takes care of everything.

cfc_comp stands for the component that that person works for. Mine is OEEAS: Office of Enumeration Earnings and Administrative Services :P

They're putting me in a coldfusion training class soon (4 days 8 hours a day) but I'm doubtful anything can be taught in a format like that. I'd rather just code until I run into a problem I can't solve, ask for help, learn from it, keep going, repeat.
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is online

  • I make this look good
  • member icon

Reputation: 1101
  • View blog
  • Posts: 2,607
  • Joined: 13-January 08

Re: Submit button not bringing up next page 500 error

Posted 13 September 2011 - 01:53 PM

So, this then is the form (boiled down):
<cfform name="cfc" action="cfc_insert.cfm" method="post">
<input type="submit" name="btnSubmit" id="btnSubmit" value="Submit" >
</cfform>


Again though, your description of what's wrong is lacking. What is it doing? You said "it doesn't bring up the next page"...but what DO you see?

While you do that, try substituting the input type="submit" with a cfinput type="submit" and see if that helps.

This post has been edited by Craig328: 13 September 2011 - 01:54 PM

Was This Post Helpful? 0
  • +
  • -

#5 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Re: Submit button not bringing up next page 500 error

Posted 13 September 2011 - 08:07 PM

Can't try the substitution at the moment because I'm not at work but I get a 500 error.

I'll try what you said and reply tomorrow.
Was This Post Helpful? 0
  • +
  • -

#6 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 06:03 AM

Ok I tried it but still the same 500 error.
Was This Post Helpful? 0
  • +
  • -

#7 Craig328  Icon User is online

  • I make this look good
  • member icon

Reputation: 1101
  • View blog
  • Posts: 2,607
  • Joined: 13-January 08

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 07:05 AM

A 500 error is an internal server error. That can be caused by code but it can also (rarely) be other, non-code things.

Is it doing that (erroring) when you hit the submit button?
Was This Post Helpful? 0
  • +
  • -

#8 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 09:59 AM

I found out what the problem was. On line 12

<cfinclude template="validate.cfm" >


There was another file that had some bad code in it. It was a mess of javascript and coldfusion. It was all the validation code. I'm just taking it out for now. My boss just wants it to work. He said he doesn't care about validation at the moment. I can't substantially change the old code right now but when I can I'm changing the inputs to cfinputs and doing the validation that way. The old coder was doing it with javascript.

Thank you for your help though.
Was This Post Helpful? 0
  • +
  • -

#9 Craig328  Icon User is online

  • I make this look good
  • member icon

Reputation: 1101
  • View blog
  • Posts: 2,607
  • Joined: 13-January 08

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 10:12 AM

Um...do yourself a favor and get your boss to commit that "skip the validation" stuff on an email or something.

Your program affects financial decisions and anytime something affects money, you need to exercise extra diligence in making sure someone doesn't try to get cute with the application by feeding additional URL elements to a submission or dropping in SQL code into a form field and other nasty tricks.

Validation helps to prevent those issues and removing it on your boss' say so is fine and all...as long as you can document that he told you to do it.

Just a word of warning.

Good luck.
Was This Post Helpful? 0
  • +
  • -

#10 maguscrowley  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-August 11

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 10:31 AM

Ever heard the saying "Good enough for government work" :P It's in an email. I think it's stupid too. All the database columns are varchars so they will take anything so it won't produce any errors. It will just be wrong. Good thing this will be an internal app because otherwise it would be wide open to a sql injection like you pointed out. No one outside of people with pin access in office of personel can get to it. Our code security is shit here but our network security is formitable. We're told not to worry about code security because everything will be internal and protected. Again I think it's a horrible practice (I am a programmer previously) but that's the way they work.
Was This Post Helpful? 0
  • +
  • -

#11 Craig328  Icon User is online

  • I make this look good
  • member icon

Reputation: 1101
  • View blog
  • Posts: 2,607
  • Joined: 13-January 08

Re: Submit button not bringing up next page 500 error

Posted 14 September 2011 - 11:28 AM

Indeed I have heard the term...sorry to hear that's the ideal under which you toil.

You do indeed have bigger fish to fry with your description of the database. Being internal will not protect if from a SQL injection attack, of course. Being internal access just limits the number of people who will be able to commit such an attack. Further, the next intranet app that I encounter that doesn't have some networked link somewhere to the outside world will be the first.

But I'm sure I'm preaching to the choir. Good to hear you have the instruction on an email. The popularity of "good enough for government work" is rivaled only by "CYA" I imagine.

In any event, glad to hear you got your error sorted out. Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1