-1

Im using the fine-uploader jquery plugin on one of my sites.

Is there a way of using a standard input button to trigger the uploads?

So for instance, someone chooses the files they want to upload, fill out the rest of the form, then hit the submit button, that will then upload the files and show the progressbar, then submit everything once the fileupload is finished?

At the moment, when i click the submit button it asks if i want to leave the page as there are files being uploaded.

This is my fineuploader code

<script>
  $(document).ready(function() {
    var manualuploader = $('#manual-fine-uploader').fineUploader({
      request: {
        endpoint: 'server/handleUploads'
      },
      validation: {
        allowedExtensions: ['jpeg', 'jpg', 'gif', 'png', 'bmp'],
        itemLimit: 3
      },
      autoUpload: false,
      text: {
        uploadButton: '<i class="icon-plus icon-white"></i> Select Files'
      }
    });

    $('#addSubmit').click(function() {
      manualuploader.fineUploader('uploadStoredFiles');
    });
  });
</script>   

The input button that needs to trigger it is the standard form submit button, like so

<input class="btn-submit" value="Submit" id="addSubmit" name="addSubmit" type="submit" />

Cheers,

BigJobbies
  • 3,633
  • 11
  • 43
  • 66

1 Answers1

1

Try:

$("selector").trigger('event');  //$("addSubmit").trigger('click');
Nil'z
  • 7,487
  • 1
  • 18
  • 28