title: How do I call a Javascript function when I click a "Submit" button?
body: <p>I am trying to implement Drag and Drop file upload functionality into a webpage. I have this javascript function in a dropzone.js file:</p>
  
  <pre><code>Dropzone.prototype.processFile = function(file) {
    this.filesProcessing.push(file);
    file.processing = true;
    this.emit("processingfile", file);
    return this.uploadFile(file);
  };
  </code></pre>
  
  <p>And I have this in my html file:</p>
  
  <pre><code>&lt;script src="dropzone.js"&gt;&lt;/script&gt;
  &lt;input type="submit" class="btn" value="Submit" /&gt;
  </code></pre>
  
  <p>I downloaded the Dropzone.js file from <a href="http://www.dropzonejs.com" rel="nofollow">http://www.dropzonejs.com</a> to implement in my page. The Dropzone has the functionality to either start uploading files as soon as they are dropped onto the page or wait until the user calls the function mentioned above. </p>
  
  <p>How do I call the function when I click the "Submit" button? I'm pretty unfamiliar with how the dropzone thing really works. The instructions from the creator of dropzone.js say I should call "myDropzone.processFile(file);" if I don't want the dropzone to immediately start uploading as soon as files are dropped into the element, but I'm not sure how to call this from my html button.</p>