2

Using blueimp jquery-file-upload, I'd like to change a variable when clicking the cancel button.
The cancel button is displayed at right of the each file added.

I tried below but nothing has been happend.
How can I do this?

$(function () {
  var file_count = 0
  $('#fileupload').fileupload({
    acceptFileTypes: /(\.|\/)(pdf|PDF)$/i        
  }).bind('fileuploadadd', function (e, data) {
    file_count += data.files.length
    $('td.cancel button.btn-warning').click(function (e) {
      file_count -= 1
    });
  });
});

1 Answer 1

1

just try it:

        $('body').on('click', 'button.cancel', function(e,data) {
            console.log('cancel click');
        });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.