[thelist] Flash Forms with CF - error diagnostics

Erik Mattheis gozz at gozz.com
Wed Aug 28 13:57:08 CDT 2002


>When a Flash form posts it can action a cfm file to receive the form data to
>be processed, much the same way as an HTML form.
>
>Does anybody have a ideas or inspiration on how to get my CF error
>diagnostics back?  The form can fail to post and nobody would ever know:(

It sounds like you're using loadVars() - you might deal with errors
better using the XML functions ... either fitting all the "form" data
in the query string and do an XML.load() to that url, or build an XML
object of the form data and post that using XML.sendAndLoad()

This way, you can trap all errors - if you formulate your responses
to start with something like <response my_app="true"> you can look
for my_app="true" and if you don't find it, you know you've received
a webserver error. And if you want to display a failure message, key
off of something else ... example:

if you make a response like this:

<response my_app="true">
   <failure>Display this error message</failure>
</response>

You can deal with it like this:

function parseMyXML() {
   if (this.firstChild.attributes.my_app != 'true') {
     // huge failure, like a 500
     return myFatalErrorMessage();
   }
   if (this.firstChild.firstChild.nodeName == 'failure') {
     // display whatever is in the failure node
     error_msg = this.firstChild.firstChild.firstChild;
     return myCustomErrorMessage(error_msg);
   }
// display a success message or whatever else
// you might want to do with an XML response.
}




--

__________________________________________
- Erik Mattheis

(612) 377 2272
http://goZz.com/

__________________________________________



More information about the thelist mailing list