I\'m using Dropzone.js to upload files to the server. I setting up my Dropzone maxFiles parameter to 10 and I was tried this:
$(\'.
Here we go, updated based on comments below.
How to disable the dropzone "click to open file dialog box" event when maxFiles is reached:
$('.dropzone').dropzone({
maxFiles: 10,
init: function() {
this.on('maxfilesreached', function() {
$('.dropzone').removeClass('dz-clickable'); // remove cursor
$('.dropzone')[0].removeEventListener('click', this.listeners[1].events.click);
});
}
I don't know how reliable the "1" in this.listeners[1] is, but that's where the click event function lives in my current dropzone configuration.