Skip to content

Instantly share code, notes, and snippets.

@robgcf
Created October 2, 2017 21:29
Show Gist options
  • Select an option

  • Save robgcf/28cff10f52a8fc54d119f6104bbbdb9f to your computer and use it in GitHub Desktop.

Select an option

Save robgcf/28cff10f52a8fc54d119f6104bbbdb9f to your computer and use it in GitHub Desktop.

Revisions

  1. robgcf created this gist Oct 2, 2017.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    // Here's the javscript:

    var myDropzone = new Dropzone(".dropzone"); // this causes an error: "dropzone is already attached"

    Dropzone.options.myDropzone = {
    dictDefaultMessage: "Drop files here or Click to upload",
    paramName: "file",
    maxFilesize: 5
    };

    // without the var myDropzone above, this causes an error about myDropzone.on is not a function.
    myDropzone.on("success", function(file) {
    getUserFiles();
    });


    // Here's the HTML:

    <form action="/whatever" class="dropzone" id="myDropzone">
    <input type="hidden" name="userid" value="1">
    </form>