Quote:However, I WOULD like to have a message display on error output for customers. Something like, "Oops, we've encountered an error while processing your form, please contact us to finish your request." Or something. Something in text, standardized, that I can customize.
I'm not sure about that. What kind of errors are you trying to catch? Actual major errors like the submission not being able to be added? With POST/Direct forms, your options are pretty limited.
But with the API, you can set the following setting to false in your global/config.php:
PHP Code:
$g_api_debug = false;
The API debugging is on by default, so whenever a problem occurs (like invalid form IDs being passed to the API functions), it displays the Form Tools error page with the appropriate error code for you to look up (see: http://docs.formtools.org/api/index.php?...rror_codes). When you set that variable to false, each function will *return* the errors instead of redirecting to the error pages. So for example, instead of calling:
PHP Code:
ft_api_process_form($params);
You would call:
PHP Code:
list($success, $error_code) = ft_api_process_form($params);
It would behave in exactly the same way except when there was an error. In those cases, it would return false for $success, and the Form Tools API error code. You could do whatever you wanted with that info.
I *think* I standardized the return values for most the API functions, but you should probably test it out and tinker with the code.
Hope this helps!
- Ben