Dropzone no url provided / Dropzone already attached
Asked Answered
S

1

11

I feel like I am loosing my mind here. I have read all the threads relating to my issue, I have added the "Dropzone.autoDiscover = false;" but nothing seems to work.

I keep getting :

Uncaught Error: No URL provided. & Uncaught Error: Dropzone already attached.

I made a basic setup to its simplest form but still does not want to work.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Dropzone</title>
    <link rel="stylesheet" href="css/main.min.css">
    </head>
    <body><div class="modal">
    <div class="modal-dialog">
    <div class="modal-header">

    </div>
    <div class="modal-body">

      <div class="modal-body__inner">

          <form action="some-url.php" >
              <div class="formfield"><label for="name">Name:</label><input type="text" name="" value=""></div>
              <div class="formfield"><label for="name">Email:</label><input type="text" name="" value=""></div>
              <div class="formfield"><label for="name">Number:</label><input type="text" name="" value=""></div>
              <div class="formfield"><div id="my-dropzone" class="dropzone"></div></div>
          </form>
      </div>

    </div>
  </div>
</div>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/dropzone.js"></script>
<script src="js/script.js"></script>

added script:

      $(document).ready(function(){
      //Dropzone Configuration
      Dropzone.autoDiscover = false;

      $('#my-dropzone').dropzone({
        url: 'post.php',
         method: 'post'
        });
      });

Not sure what i am doing wrong, this is suppose to be a simple plug and configure

Squarely answered 14/2, 2017 at 13:38 Comment(0)
O
28

Do you try to put autoDiscover option before $(document).ready? That did the trick on my side.

//Dropzone Configuration
Dropzone.autoDiscover = false;

$(document).ready(function(){

  $('#my-dropzone').dropzone({
    url: 'post.php',
    method: 'post'
  });

});`
Ouch answered 14/2, 2017 at 15:6 Comment(3)
thanks a mill, a stupid little thing like that... really appreciateSquarely
Delighted to hear! :-)Ouch
This fixed it for me, too! You're a lifesaver!Inscrutable

© 2022 - 2024 — McMap. All rights reserved.