const initDropzone = (obj) => { const newobj = obj; console.log(newobj); console.log(newobj.options); newobj.confirm = function (question, accepted, rejected) { console.log('asking question'); mscConfirm({ title: 'Management Console', subtitle: question, dismissOverlay: true, onOk() { accepted(); }, }); }; return newobj; } Dropzone.confirm = function(question, accepted, rejected) { showConfirm(question); $(document).on('click', '#accept-confirm', function() { hideConfirm(); accepted(); }); } $("div#resource_upload_{{ $lecture->id }}").dropzone({ // here go your other dropzone options // this option stops the files form auto-uploading autoProcessQueue: false, // here we add the question init: function (){ // get the dropzone object myDropzone = this; // overwrite the addedfile function myDropzone.on("addedfile", function(event) { // this is my confirm function, you can insert your var r = confirm("Press a button!"); if (r == true) { txt = "You pressed OK!"; // this starts the upload proces.... myDropzone.processQueue(); } else { // ...or not txt = "You pressed Cancel!"; } }); });