1
0
-1

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>
    CommentAdd your comment...

    2 answers

    1.  
      3
      2
      1

      Hi Anders, thanks for the response. Not sure but it seems that Joget form element is not implementing the standard dropzone remove function. After checking the fileupload.js I find out remove event can be handled using below code. 

      $(fName).on("click", ".remove", function(){ alert('remove triggered'); });
        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi, I am not familiar with dropzone perhaps you could try searching or asking in stackoverflow for better answers for example https://stackoverflow.com/questions/43434283/dropzone-js-events-not-firing

          CommentAdd your comment...