twitter-bootstrapbootstrap-file-input

Bootstrap input file event removing data


I'm using Bootstrap FileInput and it is really cool :)

I've got a problem with some events. I want to know how could I detect when I press on "Remove" button after submitting a file. Here is a pic of what I mean:

remove button

I've used "fileremoved", "filedeleted", "filepredelete", "filebeforedelete",... events (anything about "remove" or "detele"), but they don't work.

What's the event I'm looking for? Am I missing anything?

Thank you!


EDIT:

Here is my little JS code for the events:

$('#file_upload').on('filebatchuploadcomplete', function() {
    console.log("I have pressed the upload button"); // --- Ok, it works!! :)
    // More stuff here...
});

$('#file_upload').on('fileremoved', function() {
    console.log("I have pressed the remove button"); // --- Never shown!! :(
    // More stuff here...
});

Solution

  • In Bootstrap FileInput newest version, the remove event is fileclear or filecleard (https://plugins.krajee.com/file-input/plugin-events#fileclear).

    Ex: $('#input-id').on('fileclear', function(event) { console.log("fileclear"); });