<input type="file" name="ufile" onchange="showFileName(this);" />
<input type="text" name="ufilename" id="ufilename" />
<script>
function basename(path) {
if (path == null || path == undefined) return "";
var pos = path.lastIndexOf("\\");
if (pos == -1) return path;
else return path.substr(pos + 1);
}
function showFileName(file_ele) {
document.getElementById("ufilename").value = basename(file_ele.value);
}
</script>
Title:
Input type file, basename
Description:
<input type="file" name="ufile" onchange="showFileName(this);" /> <input type="text" name=&...
...
Rating:
4