Chinthu
Chinthu

Reputation: 277

jquery dropzone remove button is not working

I created a drag and drop interface for image upload using dropzone plugin.

This is the code that I'm using:

<script src="<?php echo base_url() ?>acc/assets/dropzone/dropzone.js"></script>

<form action="<?php echo base_url() ?>acc/assets/dropzone/upload.php" 
      class="dropzone" id="my-awesome-dropzone">
</form>

I also wrote the php code for uploading images and it is working.

The problem is there is no remove buttons for removing an image from the drop area. How can I enable that button?

Upvotes: 3

Views: 9154

Answers (1)

Carlos Robles
Carlos Robles

Reputation: 10947

you can read how to configure it here: http://www.dropzonejs.com/#toc_6

for create options to a dropzone that you create by simply using the dropzone class, you need to create an object called after your form's id.

Dropzone.options.myAwesomeDropzone = {
//options here
}

To add a remove or cancel button, you have to pass the option addRemoveLinks

<script src="<?php echo base_url() ?>acc/assets/dropzone/dropzone.js"></script>

Dropzone.options.myAwesomeDropzone = {
        addRemoveLinks: true

}

<form action="<?php echo base_url() ?>acc/assets/dropzone/upload.php" class="dropzone" id="my-awesome-dropzone"></form>

You can also take a look at this options:

  • dictCancelUpload: If addRemoveLinks is true, the text to be used for the cancel upload link.
  • dictCancelUploadConfirmation: If addRemoveLinks is true, the text to be used for confirmation when cancelling upload.
  • dictRemoveFile: If addRemoveLinks is true, the text to be used to remove a file

Upvotes: 7

Related Questions