I use Uploadifive and have modified a couple of things.
I made a form where people can select and input values as well as allowing people to select multiple numbers, like this:
<input type="checkbox" id="checker_tiny" name="lid[]" value="1" />
<input type="checkbox" id="checker_tiny" name="lid[]" value="2" />
<input type="checkbox" id="checker_tiny" name="lid[]" value="3" />
<input type="checkbox" id="checker_tiny" name="lid[]" value="4" />
<input type="checkbox" id="checker_tiny" name="lid[]" value="5" />
I now want the form to be send to /upload/uploadifive.php
I have tried this by the following code:
<script type="text/javascript">
//<![CDATA[
$(function() {
// Initialiseer uploadifive
$('#file_upload').uploadifive({
'auto' : false,
'checkScript' : '/uploadifive/Sample/check-exists.php',
'onFallback' : function () {
window.location = '/home.php';
},
'method' : 'post',
'queueID' : 'queue',
'uploadScript' : '/upload/uploadifive.php',
'onUploadComplete' : function (file, data) {
console.log(data);
}
});
// Hang een click-event aan de knop
$('#subby').on('click', function () {
// Werk formData van uploadifive bij met de betreffende waarden
$('#file_upload').data('uploadifive').settings.formData = {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>',
'projectnr' : $('input[name=projectnr]').val(),
'gebruiker' : $('input[name=gebruiker]').val(),
'gebruikerid' : $('input[name=userId]').val(),
'mapId' : $( "#mapId option:selected" ).val(), // moet dit niet val() zijn???
'uploadbash' : '<?php echo $uploadbash; ?>',
'upload_reden' : $( "#upload_reden option:selected" ).val(),
'todo' : $("input[name=todo]:checked").val(),
'lid' : $('input[name=lid[]]:checked').val()
};
// Voer de upload uit
$('#file_upload').uploadifive('upload');
});
});
//]]>
</script>
At the moment all the data is being sent and it works, but only the multiple number checkboxes don't send the data correctly.
I get "undefined" on /upload/uploadifive.php
What is wrong?