javascript - Input tag file value jquery -
i used bootstrap 3 model upload image, when value in file field in console got
$('input[type="file"]').val(); // = "c:\fakepath\maxresdefault.jpg"
but after send data time value in console
$('input[type="file"]').val(); // = ""
i got bad result. whats problem, selected image .and can see image name in file field result empty.how can fix it
try this:
<input type="file" name="uploader" id="uploader"> $(function(){ $('#uploader').change(function(){ console.log(this.value); }); });
Comments
Post a Comment