Can anybody give me pointers on a simple method to use cftry/cfcatch and
cferror functionality to aggregate multiple errors into a single error display?
This is for a user validation type function. I have several error blocks such
as these.
<cfif not len(trim(form.service_Code)) AND not len(trim(form.product_Code))>
<cfthrow errorcode="CPT_001" message="No Service or Product Code
entered, one is required.">
</cfif>
<cfif len(trim(form.service_Code)) AND len(trim(form.product_Code))>
<cfthrow errorcode="CPT_002" message="Both Service and Product Code
entered, only one is allowed.">
</cfif>
This works well, but as soon as any error is triggered, the page is thrown to
the form_exception page defined in the <cferror> tag in the application.cfm
file which displays that one error.
It has been suggested that a better user expierence would be to find all errors
first and then display them on the exception page. Can I do this with the
above logic, or am I going to have to completely build a custom error/exception
process?
I thought I could wrap each section in its own try/catch block which would
allow me to agregate all the errors into an array. But then I could not see a
way to throw the entire array to the exception page.
--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
"C code. C code run. Run code run. Please!"
- Cynthia Dunning
Confidentiality Notice: This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205390
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54