Wait until fine-uploader submits all files before submitting form
<p>uploader's community!<br><br>
I am trying to integrate fine-uploader with shrine(ROR).<br>
I am already able to upload images to the server endpoint.<br>
In order to store uploaded photos definitively i opted for sending uploaded photo information(received form the server) with my existing form via ajax.</p>

<p>My existing form looks like this </p>

<pre><code>&lt;form id="myform" method="post" action="some_path"&gt;
    &lt;input type="text" name="name"/&gt;
    &lt;input type="text" name="email"/&gt;
    &lt;input type="text" name="phone"/&gt;
    &lt;input type="password" name="password"/&gt;
    &lt;input type="submit" /&gt;
    Add some photos
    &lt;div id="fine-uploader-gallery"&gt;&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>My fine uploader configuration:</p>

<pre><code>$(function() {

var fineuploader = new qq.FineUploader({
  element: document.getElementById("fine-uploader-gallery"),
  template: 'qq-template-gallery',
  debug: true,
  request: {
    endpoint: 'images/cache/upload',
    inputName: "file"

  },
  thumbnails: {
    placeholders: {
      waitingPath: "fine-uploader/placeholders/waiting-generic.png",
      notAvailablePath: "fine-uploader/placeholders/not_available-generic.png"

    }

  },
  validation: {
    allowedExtensions: ['jpeg', 'jpg', 'gif', 'png']

  }

  callbacks: {
    onComplete: maybe add the responseJSON to a local variable and send it later with the form via ajax.
    }
}


});

});
</code></pre>

<p>My question is: <br>
How to intercept the sumbit button, so that if fine-uploader is uploading some files :<br>
The form won't be sent, it waits until all uploads are finished and then send it along with the information recieved from the server for each uploaded file(responseJSON).<br>
Hope my question is clear!</p>