I want to create multiple Dropzone (Dropzone.js) on a single page. But I'm getting this error:
Dropzone already attached.
Thats what I tried so far:
var firstDropZone = new Dropzone(document.body, {url: '/upload'});
var secondDropZone = new Dropzone(document.body, {url: '/upload'});
This is possible by creating multiple form elements and bind the Dropzone manually on it. You have to add a unique “id” to your form elements. Please note: You cannot bind multiple Dropzones on the same element like you tried:
HTML
<form action="/upload" class="dropzone" id="first"></form>
<form action="/upload" class="dropzone" id="second"></form>
JavaScript
var firstDropZone = new Dropzone('#first', {
url: '/upload'
});
var secondDropZone = new Dropzone('#second', {
url: '/upload'
});