title: How to set one Dropify input for multiple button?
body: <p>I have a customer list and table and an edit button on each row. I use a modal form to edit customer information and I have a dropify input field to change customer image. When edit button clicked, if exist, I set default image to dropify and modal close button clicked form values and dropify is rested. Everything is ok till that point. When I click another edit button on list it doesn't set default value to dropify. You can check my codes below. Is anyone can be helpful, I'll be glad. Thank you.</p>
  
  <pre><code>&lt;div class="modal fade modal-primary" id="editCustomerModal" aria-hidden="true" role="dialog" tabindex="-1"&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" id="closeEditModal" aria-label="Close"&gt;
            &lt;span aria-hidden="true"&gt;×&lt;/span&gt;
          &lt;/button&gt;
          &lt;h4 class="modal-title"&gt;Edit Customer&lt;/h4&gt;
        &lt;/div&gt;
          &lt;div class="modal-body"&gt;
            &lt;form class="form-horizontal" id="editCustomer" enctype="multipart/form-data" autocomplete="off"&gt;
                &lt;div class="form-group row"&gt;
                    &lt;label class="col-xs-12 col-sm-3 form-control-label"&gt;Logo:&lt;/label&gt;
                    &lt;div class="col-sm-9 col-xs-12"&gt;
                        &lt;input type="file" name="image" class="editDropify" /&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/form&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer p-0"&gt;
              &lt;div class="row no-space"&gt;
                  &lt;div class="col-xs-12 col-sm-6"&gt;
                      &lt;button type="button" class="btn btn-danger btn-block h-50 font-size-18" style="border-radius: 0;" data-dismiss="modal"&gt;&lt;i class="icon fa-close" aria-hidden="true"&gt;&lt;/i&gt; İptal &lt;/button&gt;
                  &lt;/div&gt;
                  &lt;div class="col-xs-12 col-sm-6"&gt;
                      &lt;button type="submit" form="editCustomer" class="btn btn-success btn-block h-50 font-size-18" id="submitEditCustomer" style="border-radius: 0;"&gt;&lt;i class="icon fa-save" aria-hidden="true"&gt;&lt;/i&gt; Kaydet &lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
          $(document).on('click', '.editButton', function() {
  
                  compLogo = $(this).closest("tr").children("td:eq(3)").children("img").attr("src"),
  
                  editCompId = $(this).data("edit-id");
  
              $("#editCustomer input[name='which_content']").val(editCompId);
  
              $("#editCustomerModal").modal({backdrop: "static"});
  
              $(".editDropify").dropify({defaultFile: compLogo});
  
          });
  
  
  
          $('#editCustomer')
              .formValidation({
                  framework: "bootstrap4",
                  button: {
                    selector: '#submitEditCustomer',
                    disabled: 'disabled'
                  },
                  icon: null,
                  fields: {
                     // valiations
                  },
                  err: {
                    clazz: 'text-help'
                  },
                  row: {
                    invalid: 'has-danger'
                  }
              })
  
              .on('success.form.fv', function(e) {
                  e.preventDefault();
  
                  var formDatas = new FormData($("#editCustomer")[0]);
  
                  $.ajax({
                      type: "POST",
                      url: "editSomething.php",
                      data: formDatas,
                      cache: false,
                      contentType: false,
                      processData: false
                  })
  
              .success(function(editCompId) {
                  // success operations and modal close
                  $("#editCustomerModal").modal('hide');
  
                  });
              });
  
          $(document).on('click', '.close', function () {
  
              // with modal close button clearing dropify element
  
              var drEvent = $('.editDropify').dropify();
                  drEvent = drEvent.data('dropify');
                  drEvent.resetPreview(); 
                  drEvent.clearElement(); 
  
              $("#editCustomerModal").modal('hide');
          });
  &lt;/script&gt;
  </code></pre>