I'm searching the method to make div into dropzone, because I want the dropzone stay inside other html form.
so I found the jquery method
<script>
Dropzone.autoDiscover = false;
jQuery(document).ready(function() {
$("#mydropzone").dropzone({
url: "path/to/file",
autoProcessQueue: false
});
});
$(document).on('click', '#btn_special', function () {
// enable auto process queue after uploading started
Dropzone.options.autoProcessQueue = true;
// queue processing
Dropzone.processQueue(); ///////////// it's not work ///////
});
</script>
<form action="some_page.php" method="post">
<table>
<tr>
<td>Member Name</td>
<td><input type="text" name="member_name" /> </td>
</tr>
</table>
<div class="dropzone dropzone-previews" id="mydropzone"> <!-- My dropzone stay at this --></div>
<button type="button" id="btn_special">Upload</button>
<input type="submit" name="submit_htmlform" value="submit" />
</form>
.. The Problem is I don't know the jquery method to make dropzone submit( Dropzone.processQueue(); ) I know only javascript method. but also I don't know javascript method to convert the div element to dropzone. How should I do?
Try to change your js like this :
jQuery(document).ready(function() {
var myDropZone = $("#mydropzone").dropzone({
url: "path/to/file",
autoProcessQueue: false,
});
$(document).on('click', '#btn_special', function () {
myDropZone.options.autoProcessQueue = true;
myDropZone.processQueue();
});
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.