Tracking group upload with widget

104 Views Asked by At

I deployed Uploadcare and would like to track the widget multifilepick progress. My code:

function placeOrder(){
      var widgets = uploadcare.initialize();
      var widget = uploadcare.MultipleWidget('[role=uploadcare-uploader][data-multiple]');
      widget.onUploadComplete(function(info) {
            $('#orderForm').find('[type="submit"]').trigger('click');
        });   
  };

Trying to execute a submit button only when the upload is complete. Here are the issues:

  1. If a user clicks the button during upload the trigger gets fired immediately the upload completes taking away control from the user.
  2. If a user clicks the button only after upload completes, nothing happens.

Anyone out there that can help? Thanks.

0

There are 0 best solutions below