Set Input Value In Form From Another Input , Dynamically
I trying to upload image to website with its title . I want user to see image before uploading . HTML                   
Image Uploader
Solution 1:
maybe this can help you.
<div class="container">
    <h1>Image Uploader</h1>
    <input id="fileItem" type="file" name="images[]" id="images" multiple>
    <br>
    <div id="images-to-upload" class="row">
    </div>
    <br>
    <div class="col-md-12">
     <button id="upload_button" class="btn btn-sm btn-success col-md-4 col-xs-12">Upload all images</button>
    </div>
 </div>
Javascript
$('#upload_button').click(function(){
    var files = document.getElementById('fileItem').files;
    console.log(files)
    $.each(files, function(index, item) {
       //console.log(index, item);
       console.log(item.name);
       // here you can do anything with name of file.
      // maybe here you can create your form
    });
  });
test it jsfiddle
Post a Comment for "Set Input Value In Form From Another Input , Dynamically"