72
rated 0 times
[
79]
[
7]
/ answers: 1 / hits: 24292
/ 11 Years ago, sat, july 13, 2013, 12:00:00
I have the following JS / HTML code:
<input type=text class=file name=file_info id=file_info>
<div class=file_upload>
<input type=file id=file_upload onchange=name();>
</div>
<script>
function name() {
var fileName = document.getElementById(file_upload).value;
var fnSplit = fileName.split(/[/\]/);
fileName = fnSplit[fnSplit.length - 1];
document.getElementById('file_info').innerHTML = 'Fred Flinstone';
}
</script>
I want that after I upload file, the file-name will shown in the tput text, but this cide doesn't work.
How can I fix it?
Update : The file name should be inside the input text
More From » html