Scot's Scripts
Scot's Scripts

Reputation: 302

How do I display a fine-uploader error message in a div?

In my application there is an option to skip the upload if the image exists. If this happens I want to display an error in a div instead of in a popup alert box. In the docs it gives this example which works for the alert box:

callbacks: {
 onError: function(id, name, errorReason, xhrOrXdr) {
  alert(qq.format("Error on file number {} - {}.  Reason: {}", id, name, errorReason));
  }
}

How would I display the same message inside a div on the page using jquery? Such as:

<div id="error"></div> 

I've tried a few things but just get js errors. I'm not a jquery/js guru, so any help is much appreciated!

Upvotes: 0

Views: 726

Answers (1)

Scot&#39;s Scripts
Scot&#39;s Scripts

Reputation: 302

I just wanted to put an answer up for this because Karthik's comment worked perfectly.

"Replacing alert with

$("#error").text(qq.format("Error on file number {} - {}. Reason: {}", id, name, errorReason)) 

should work – Karthik Ganesan"

Upvotes: 1

Related Questions