Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
125
rated 0 times [  126] [ 1]  / answers: 1 / hits: 33548  / 10 Years ago, thu, june 12, 2014, 12:00:00

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:



$('.dropzone').dropzone({
maxFiles: 10,
init: function() {
this.on('maxfilesreached', function() {
$('.dropzone').unbind('click');
});
}
});


...but not working. What is the solution to remove clickable from .dropzone or any other way to prevent user to add more files?


More From » jquery

 Answers
21

Why do not you just use CSS to disable the click event.
When max files is reached, Dropzone will automatically add a class of dz-max-files-reached.



Use css to disable click on dropzone:



.dz-max-files-reached {
pointer-events: none;
cursor: default;
}

[#70596] Wednesday, June 11, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skylerselenem

Total Points: 282
Total Questions: 101
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
;