​ Custom File Input Smart way

http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/
<script>
function setfilename(val)
{
var fileName = val.substr(val.lastIndexOf(“\\”)+1, val.length);
document.getElementById(“filename”).value = fileName;
}
</script>
<form>
File: <input type=”file” id=”file” name=”file” onchange=”setfilename(this.value);”/>
Upload File : <input type=”text” id=”filename”/>
</form>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *