Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 937
Chinthu Avatar asked Apr 11 '26 19:04

Chinthu


1 Answers

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
like image 197
Carlos Robles Avatar answered Apr 13 '26 09:04

Carlos Robles



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!