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:
- If a user clicks the button during upload the trigger gets fired immediately the upload completes taking away control from the user.
- If a user clicks the button only after upload completes, nothing happens.
Anyone out there that can help? Thanks.