1

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.

XXDebugger
  • 1,581
  • 3
  • 26
  • 48
  • http://stackoverflow.com/questions/7321855/how-do-i-auto-submit-an-upload-form-when-a-file-is-selected – Travis Sharp May 08 '15 at 23:26
  • I want to add both the buttons btnChooseFiles and btnImport and just hide the first one. as I have some events using both the buttons and I cant really change my whole code. – XXDebugger May 08 '15 at 23:45
  • Not clear..what is it that you want to do? hide the multiple import button? can you elaborate on your query? – Abhinav May 09 '15 at 03:53
  • I want to hide the choose files button, so when you click import it will choose the files and import in the database as well. – XXDebugger May 11 '15 at 16:42

0 Answers0