Topic: Issue submitting the form
Dear All,
Basically, I have a big form, and inside this one, I added plupload :
<div id="uploader">
<p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
</div>
When I click on the submit button, photos uploading starts and finished but the main form is not submitted.
Should I provide more code?
I'am using this code for the JS part:
$(function() {
// jQuery plupload : Convert divs to queue widgets when the DOM is ready
$("#uploader").pluploadQueue({
// General settings
runtimes : 'gears,flash,silverlight,browserplus,html5',
url : '../x-upload/upload.php',
max_file_size : '5mb',
chunk_size : '100kb',
unique_names : true,
// Resize images on clientside if we can
resize : {width : 800, height : 600, quality : 60},
// Specify what files to browse for
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
],
// Flash settings
flash_swf_url : '../x-upload/js/plupload.flash.swf',
// Silverlight settings
silverlight_xap_url : '../x-upload/js/plupload.silverlight.xap'
});
// Client side form validation
$('form').submit(function(e) {
var uploader = $('#uploader').pluploadQueue();
// Validate number of uploaded files
if (uploader.total.uploaded == 0) {
// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('UploadProgress', function() {
if (uploader.total.uploaded == uploader.files.length)
$('form').submit();
});
uploader.start();
} else
alert('You must at least upload one file.');
e.preventDefault();
}
});
});
I'll be back here tomorrow.