I have to use dropzone.js form, which sends a couple of inputs and a file upload info to the other page.
My dropzone code looks like this -- >
Dropzone.
I have been working on this as well and finally stumbled across the answer on the bootstrap page.
The key is setting the clickable:
option to wherever you want your active Dropzone area to be. Using your example, if you want your preview area to also be your drop/click area, set clickable:'#dropzonePreview',
and that will make that area active. If you want the "Drop Files" image displayed in there as well use this:
<div id="dropzonePreview" class="dz-default dz-message">
<span>Drop files here to upload</span>
</div>
This allows you to use a single Dropzone form (thus all fields get submitted as one) while still allowing you to have a smaller area designated for dropping/clicking.
One note though, don't make it too small, as if you drag and drop outside the area it loads the image in the browser in place of the page.
The documentation says to set the option: "clickable: true", but...
My problem was I had added visible markup within the upload form (box). If you want every point in the box to be clickable, you can't include any other visible markup in your view, you need to add it to the option "dictDefaultMessage."
Alternatively you can create dropzones programmaticaly (even on non form elements) by instantiating the Dropzone class http://www.dropzonejs.com/#toc_4
You need to add the dz-clickable class to your desired element.
HTML
<div class="dropzone dz-clickable" id="myDrop">
<div class="dz-default dz-message" data-dz-message="">
<span>Drop files here to upload</span>
</div>
</div>
JavaScript
// Dropzone class:
var myDropzone = new Dropzone("div#myDrop", { url: "/file/post"});
// If you use jQuery, you can use the jQuery plugin Dropzone ships with:
$("div#myDrop").dropzone({ url: "/file/post" });
Note
If you receive a console error saying: Dropzone already attached
, make sure to add this line before initiating your new Dropzone object.
Dropzone.autoDiscover = false;