I want to hide the import multiple files but instead of choosing files using one button and then import using other.
I tried the same but as soon as the popup opens for choosing the files the control shifts to the controller and the file is imported with no name.
#btnChooseFiles {
display:none;
}
<form action="/home/uploadReport" method="POST" enctype="multipart/form-data" id="form_upload">
<input id="btnChooseFiles" class="small button" name="fileName" type="file" multiple="true" >
<button id="btnImport" class="small button">Import</button>
<input type="hidden" path="ImportMultipleFile" name="ImportMultipleFile" /> <!-- takes multiple files for upload -->
</form>
$('#btnImport').click( function() {
$('#btnChooseFiles').trigger('click');
});
the code works if I have 2 different buttons.