Plupload add files disable after upload.stop() -
tring send param uploaded file, want check field param value compiled.
can check , stop upload if field empty, after upload stopped select files button still hidden , disabled.
after stopped upload want buttons @ same state @ plugin init can compile required field , start upload again or select more files.
code:
`
var uploadinitialized = false; function validateform() { alert('error'); return false; } var uploader = $("#uploader").pluploadqueue({ // general settings runtimes : 'html5,html4', url : 'http://www.example.com', max_file_size : '200mb', chunk_size : '1mb', unique_names : true, multiple_queues: true, // specify files browse filters : [ {title : "image files", extensions : "jpg,gif,png,eps,jpeg,pdf,tiff,tif"}, {title : "zip files", extensions : "zip"} ], init : { statechanged: function(up) { if (!uploadinitialized && up.state == plupload.started) { if (!validateform()) { up.stop(); } else { uploadinitialized = true; } } else { if (up.files.length === (up.total.uploaded + up.total.failed)) { $('form')[0].submit(); } } } } });
`
jsfiddle link show problem: http://jsfiddle.net/wqw4w/154/
Comments
Post a Comment