Welcome Guest Search | Active Topics | Sign In | Register

Custom Error Messages Options
Dekaiden
Posted: Wednesday, November 12, 2008 5:48:18 PM
Rank: Member
Groups: Member

Joined: 10/28/2008
Posts: 12
Good Evening,

I would like to start by apologizing for my incompetence in JavaScript. None-the-less, I've been messing around trying to figure this out and I'm only getting frustrated. First, I can't figure out how to turn off the default debug error message. Second, I'm using the AJAX Uploader and I need a custom error message when the user enters an unsupported file format. If at all possible, I would like the error message to tell them which file or extension it was. I've tried looking at the help in the documentation that came with the uploader but due to my lack of experience with JavaScript, I can't really hash it out. Any help or guidance would be very much appreciated.

Respectfully,
Dekaiden
eo_support
Posted: Wednesday, November 12, 2008 6:05:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would do something like this:

Code: HTML/ASPX
<eo:AJAXUploader ClientSideOnError="your_error_handler" ....>
....
</eo:AJAXUploader>


Code: JavaScript
function your_error_handler(control, error, message)
{
   if (error == "max_size_exceeded")
      alert("custom message for max_size_exceeded!");
   ......
}


You can see a complete list of possible "error" values here:

http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Handlers.clientside_error_handler.html

Hope this helps.

Thanks
Dekaiden
Posted: Wednesday, November 12, 2008 6:11:47 PM
Rank: Member
Groups: Member

Joined: 10/28/2008
Posts: 12
Good Evening,

I've already looked at those but don't really know how to get them to work. I've already tried a few variations. Is there a completed (or nearly completed) example I could look at?

Respectfully,
Dekaiden
eo_support
Posted: Wednesday, November 12, 2008 6:28:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Here is a working example:

http://www.essentialobjects.com/Demo/Default.aspx?path=AJAXUploader\_i12

You can check the source code to see how it works.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.