0

I'm trying to make a multiple photo upload, but it doesn't. I used the input between <p></p> and now I made an ECHO in PHP with a table and put the input in a <tr><td>. I change the code in jQuery but it doesn't work anymore. Can someone help me?

This is the code:

jQuery:

    $(document).ready(function(){
   $('#add_more').click(function(){
       var current_count = $('input[type="file"]').length;
       var next_count = current_count + 1;

       $('#file_upload').prepend('<tr><td colspan="1">Fotka : </td><td colspan="2"><input type="file" name="file_' + next_count + '" /></td></tr>');
   });
});

And this is the PHP. I had to make ECHO because I'm making an administration and I'm using parameters.

    echo '  <tr><td colspan="1">Fotka : </td><td colspan="2"><input type="file" name="file_1"></td></tr>

No problem with PHP. Don't pay attention to the quotes. I closed them in another line. Thanks

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
  • Try to use jQuery free plugin. here is the link http://www.jotform.org/jquery/ajax-multi-file-upload-with-progress-bar/#more-291 – Pradeep shyam Sep 28 '13 at 17:58
  • thanks.I wil use, but at the moment i would to do it in my way,because we can upload to our school server only 2mb/upload.So,if i would use the input type...i think will be better,after that i will change it! :) – Cudelcu Medvidek Emilek Sep 28 '13 at 18:16
  • Basically, every upload plugin will works with input type file. Check this. http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery but it works on modern browser. – Pradeep shyam Sep 28 '13 at 18:40
  • I would recommend [plupload](http://www.plupload.com/) since it supports several upload technologies, and gives you graceful failure if your users are using old browsers. – atomman Sep 28 '13 at 19:18

0 Answers0