Link to home
Start Free TrialLog in
Avatar of Quack
QuackFlag for United States of America

asked on

try catch errror in log when trying to validate a cold fusion form.

I have a cold fusion form which requires me to add a try catch around the form fields. I keep getting an error message however when I try to add it. Code below thanks for any help you provide if you see something obvious I'm missing.
 <cftry> 	
   	<cfif NOT refind("^[DdFfGgHhNnVv][A-Za-z0-9]{1,21}$", form.Contract_Number) AND NOT refind("^70[Zz]0[a-zA-Z0-9]{2}\d{2}[a-zA-Z][a-zA-Z0-9]{8}$", form.Contract_Number)>
   	<cfcatch>
	   <cfset #session.invoiceDataContr.errorString# = "The Contract Number is required and can contain no more than 22 alphanumeric characters.,">
	</cfif>
    </cfcatch>
</cftry>

Open in new window


error log message:
"Error","ajp-bio-8012-exec-3","07/25/17","11:45:07",,"Context validation error for the cfcatch tag.The tag must be nested inside a CFTRY tag. The specific sequence of files included or processed is: D:\inetpub\wwwroot\centralinv\central_inv_contr_verify.cfm, line: 121 "
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Quack

ASKER

thanks!!