I'm trying to have multiple images uploaded by a user passed through a function and then processed with the submit of the form. I have the following form which takes in the users upload files:
<form id="formUploadFile" action="<?php echo $uploadHandler ?>"
enctype="multipart/form-data" method="post" >
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>">
</p>
<p align="center">
<label for="file" >First, Choose up to 20 images!</label>
<input type="file" name="files[]" multiple />
</p>
</p>
<p class="text-center">
<h5>Then, Choose your Difficulty!</h5>
<div class="btn-group">n>
<button type="button" class="btn btn-success" value="Novice" onclick="changeDifficulty(1)">Novice</button>
<button type="button" class="btn btn-success" value="Intermediate" onclick="changeDifficulty(2)">Intermediate</button>
</div>
</p>
</form>
And then I have the following function which takes in the difficulty choice, displays a loading circle and then should submit the form with the multiple images:
<script>
function changeDifficulty(number){
var difficulty = document.getElementById('hiddDiff');
var form = getElementById('formUploadFile');
difficulty.value = number;
document.getElementById('hide-div').style.display='none';
document.getElementById('hide-div2').style.display='none';
document.getElementById('loadingScreen').style.display='block';
form.submit();
}
However, the image files are not being submitted with the form... if I take away the "multiple" statement in the line, then this code will pass one image successfully. Any help is appreciated.