Halnex
Halnex

Reputation: 4526

Dropzone.js upload box will not display

I am trying to incorporate Dropzone's upload feature into my Laravel 4 app.

I have include the js/css file in my master layout like so

{{ HTML::style('packages/bootstrap/css/dropzone.css') }}
{{ HTML::script('packages/bootstrap/js/dropzone.js') }}

Then I included the html form where I want the box to appear, in add.blade.php

<form action="/file-upload" class="dropzone" id="my-awesome-dropzone"></form>

But when I navigate to listings/add I cannot see the dropzone. Is there anything else I need to include for it to show up?

Upvotes: 0

Views: 1732

Answers (2)

Crasher
Crasher

Reputation: 2513

Make sure you are not nesting form tags, that would prevent the box showing.

Upvotes: 1

Jmh2013
Jmh2013

Reputation: 2777

Instantiate the dropzone class on the page.

$("#my-awesome-dropzone").dropzone({ url: "/file-upload" });

This way you could also add in some options that dropzone ships with.

Upvotes: 0

Related Questions