I am trying to disable a button when uploading started in dropzone and enable that button after completion of file upload.
I can enable button in success event. but after starting upload; which event i can disable button?
my code is
//Simple Dropzonejs
$("#dZUpload").dropzone({
url: "hn_SimpeFileUploader.ashx",
maxFiles: 100,
maxFilesize: 2,
addRemoveLinks: false,
acceptedFiles: "application/pdf",
autoProcessQueue: false,
success: function(file, response) {
var submit2 = document.getElementById('<%= UploadButton.ClientID %>');
submit2.disabled = false;
var imgName = response;
file.previewElement.classList.add("dz-success");
console.log("Successfully uploaded :" + imgName);
var totalfilesize = 0;
var obj = {};
obj.name = file.name;
$.ajax({
type: "POST",
url: "DUpload.aspx/SendP",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(r) {
//alert(r.d);
}
});
},
error: function(file, response) {
file.previewElement.classList.add("dz-error");
}
});
});