jQuery solution for dynamically uploading multiple files
问题 I have a form in which I am uploading pictures. I don't know how many pictures I may upload at a specific time. Are there any jQuery/AJAX solutions for dynamically adding a file upload field in a form? 回答1: simple code for adding a file field in form using jQuery <form id="myForm" action="your-action"> <input type="file" name="files[]" /> <a href="#" onclick="addMoreFiles()">Add More</a> </form> <script> function addMoreFiles(){ $("#myForm").append('<input type="file" name="files[]" />') } <