javascript - Display the Name of the File in File Upload Button -
here fiddle
this css:
label input[type="file"] { display: block; margin-top: -20px; opacity: 0; }
here have text instead of file upload button (as given opacity:0)
how can display file name chosen
note : want display file name near upload text
one way set value of tag current value of file input adding onchange event:
document.getelementbyid('spanfilename').innerhtml = this.value
as can see in full example:
upload file: <input type="file" onchange=" document.getelementbyid('spanfilename').innerhtml = this.value; imagechangesupplier(this,57);" style="display:block;margin-top: -20px;opacity: 0;" > <br /> <br /> file selected: <span id='spanfilename'></span>
Comments
Post a Comment