• Resolved Ron Phillips

    (@netizenron)


    Hi All,

    I’m trying to use dropzonejs on a the frontend. When I enqueued the script and css, the dropzonejs form worked without out calling an instance. By work, I could drag files into the dropzone and they were uploaded to the upload folder structure. The issue I’m having is hooking into the script and modifying the variables, as well as capture the file data so that I can add them to the media library and attach to a specific post. When I try to hook the name Dropzone, it says it doesn’t exist, but that is the name every reference I’ve found utilizes. Does WordPress have a built in hook with a different name?

    <div id="fancy-contact-form">
      <form action="?step=review&id=<?=$_GET['id']?>" method="post" class="dropzone dz-clickable" enctype="multipart/form-data">
        <div class="dz-default dz-message"><span>Drop files here to upload</span></div>
        <input type="hidden" name="submitted" value="1">
        <p align="right"><input type="Submit" value="Upload files"></p>
      </form>
    </div>
    
    <script type='text/javascript'>
        window.onload = function() {
            Dropzone.autoDiscover = false;
            Dropzone.options.dropzoneForm = {
                autoProcessQueue: false,
                parallelUploads: 10, 
                addRemoveLinks: true,
                init: function() {
                   myDropzone = this;
                }
            }
        }
    </script>

    I’m using WP 5.7.

    Thank you.

    -Ron

Viewing 1 replies (of 1 total)
  • Thread Starter Ron Phillips

    (@netizenron)

    Hi all,

    Simple issue. I didn’t add the ID to the form. D’oh!

    Thanks for looking if you looked.

    -Ron

Viewing 1 replies (of 1 total)
  • The topic ‘DropZoneJS hook’ is closed to new replies.