javascript - Changing upload placeholder after chose file -
i have code currently:
html:
<div class="row upload"> <form enctype="multipart/form-data" action="" method="post" class="col-md-12"> <label for="file" class="filebutton">no file has been selected</label> <input style="opacity:0" type="file" name="file" id="file" /> </form> </div><!--end of row upload-->
css:
label { background-color: #eeeeee; width: 500px; height:50px; font-weight: normal; color: #777777; padding:20px; margin-top: 10px; }
as can see, when file chosen, placeholder still remains same. want placeholder file directory when file chosen.
fiddle: http://jsfiddle.net/7rtj5/
test :
html :
<div class="row upload"> <form enctype="multipart/form-data" action="" method="post" class="col-md-12"> <input id="uploadfile" placeholder="choose file" disabled="disabled" /> <label for="file" class="filebutton">no file has been selected</label> <input style="opacity:0" type="file" name="file" id="file" /> </form> </div><!--end of row upload-->
js:
document.getelementbyid("file").onchange = function () { document.getelementbyid("uploadfile").value = this.value; };
Comments
Post a Comment