Validating with hidden form fields - how to use my own formatting for error messages?
I'm using CF's built-in form validation method that uses hidden form fields for validation (see http://livedocs.adobe.com/coldfusion/7/htmldocs/1385.htm#1154690) How do I apply my own formatting to those error messages? Thanks, Pete ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272020 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Validating with hidden form fields - how to use my own formatting for error messages?
How do I apply my own formatting to those error messages? One method is to use the cferror... tag. You can use this tag to call any page you want to display this type of exceptions, and that page can then format the output as you desire. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Sudoku | | | - 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. ~| ColdFusion MX7 by AdobeĀ® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272021 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Validating with hidden form fields - how to use my own formatting for error messages?
Thanks Ian, that helped. I found that using cferror doesn't allow me to use my normal site template, so since I'm using application.cfc, I used the onError method. This is what I did, and it allowed me to use my normal site template: cffunction name=onError output=true cfargument name=exception required=true/ cfargument name=eventName type=String required=true/ !--- Log all errors. --- !--- Display an error message if there is a page context. --- cfif (trim(arguments.eventName) IS NOT onSessionEnd) AND (trim(arguments.eventName) IS NOT onApplicationEnd) cflog file=#this.name# type=error text=Event name: #arguments.eventName# cflog file=#this.name# type=error text=Message: #arguments.exception.message# cfif arguments.exception.stackTrace CONTAINS FormValidationException cfset request.page.title = Form validation error cfsavecontent variable=errorcontent p class=action-responseA form validation error has occurred./p ul cfoutput#arguments.exception.errors#/cfoutput /ul p class=action-responsePlease a href=javascript:history.go(-1);go back/a and correct the problems./p /cfsavecontent cfelse cfset request.page.title = An unexpected error has occurred cfsavecontent variable=errorcontent p class=action-responsePlease provide the following information to technical support:/p p class=action-responseError Event: #arguments.eventName#/p p class=action-responseError details:/p /cfsavecontent /cfif cfimport taglib=/extensions/customtags/ prefix=ct cfoutput ct:uitemplate #errorcontent# cfif CGI.server_name CONTAINS localhost cfdump var=#arguments.exception# label=Error details expand=no /cfif /ct:uitemplate /cfoutput cfelseif (arguments.eventName IS onApplicationEnd) cflog file=#this.name# type=Information text=Application #this.name# Ended /cfif /cffunction ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2. Free Trial http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272028 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4