2
我想在dropzone中啓動上傳時禁用按鈕,並在完成文件上傳後啓用該按鈕。在DropZone中上傳文件時禁用按鈕
我可以在成功事件中啓用按鈕。但開始上傳後;哪些事件我可以禁用按鈕?
我的代碼是
//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");
}
});
});
但是,這裏是代碼? –
@PranavPatel plz立即檢查。 – Jkrish
['addedfile'](http://www.dropzonejs.com/#event-addedfile)和['complete'](http://www.dropzonejs.com/#event-complete)事件如何.. – Rayon