Is there any way to use Dropzone js without using Form. I want to use like following.But in this way image preview is not showing.
<div class="dropzone" id="dropzoneForm">
<div class="fallback">
<input name="file" type="file" multiple/>
</div>
</div>
Read more through in the docs
and it will explain many problems people faces these days.. Anyways Here is the solution to your problem:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css/basic.css" />
<link rel="stylesheet" href="css/dropzone.css" />
<script src="dropzone.min.js"></script>
<script>
var myDropzone = new Dropzone("div#myId", {
url: "/file/post"
});
$("div#myId").dropzone({
url: "/file/post"
});
</script>
</head>
<body>
<div id="myId" class="fallback dropzone">
<input name="file" type="file" multiple />
</div>
</body>
What im doing here is giving the div a url to link to so you dont have to use a form!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With