I have a simple function that a user can submit a details of his/her past and current projects, and I am using dropzone so users can upload related documents to their project. So basically, they can add many projects as they like
Currently, I set to autoProcessQueue: true,
the dropzone, so when user drop a file, it will be automatically uploaded.
var dynamicDropzone = new Dropzone(element, {
autoProcessQueue: true,
addRemoveLinks: true,
parallelUploads: 1,
maxFilesize: 5,
acceptedFiles: 'image/*,application/pdf',
dictDefaultMessage: '<div class="dz-default dz-message"></div>',
url: tempURL + 'upload.php',
params: {
'userID': current_user_id,
},
What I want is all the dropzone instance will be start uploading all files in a 1 single button trigger.
My issue is since users can add project dynamically, the dropzones in not triggering upload when click the button
$("#button").click(function (e) {
e.preventDefault();
dynamicDropzone.processQueue();
});
button type="submit" id="button" class="btn btn-primary">Submit</button>