File Upload (Dropzone) removedfile event not triggered
Confluence User - 15 Aug, 2018
Hi,
In form builder, I'm trying to display some information (content) of the uploaded file in custom HTML.
I have been able to catch the "addedfile" and "success" event and display di file information. However I'm unable to get the "removedfile" event to clear the file information if user remove it from the form.
Below is the code I'm working on, the add and success message box is triggered when file added, but remove event is never triggered. Please advice how to catch the event.
<script>
var fName = "#" + $("#mpfMain_1_demoData_fileUpload").closest("div").attr("id");
$(function() {
var myDropzone = Dropzone.forElement(fName);
myDropzone.addRemoveLinks = true;
myDropzone.on("removedfile", function(file){
alert('remove triggered');
});
myDropzone.on("addedfile", function(file){
alert('add triggered');
});
myDropzone.on("success", function(file){
alert('success triggered');
});
});
</script>
forms;fileupload;dropzone