javascript - How can I display the file name with file upload -


i want show file name while uploading file.for used hidden field. code is

<label>file</lable> <input type="image" src="http://upload.wikimedia.org/wikipedia/commons/c/ca/button-lightblue.svg" width="30px"/> <input type="file" id="my_file" style="display: none;" /> 

javascript is

$("input[type='image']").click(function() {     $("input[id='my_file']").click(); }); 

how can this?

you can this:

$("input[type='image']").click(function () {     $("input[id='my_file']").click(); });  $("input[id='my_file']").change(function (e) {     var $this = $(this);     $this.next().html($this.val().split('\\').pop()); }); 

fiddle


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -