mirror of
https://github.com/alvierahman90/uploadr.git
synced 2025-01-26 10:23:24 +00:00
Show filename if selected
This commit is contained in:
parent
a1c555847d
commit
c47b246b80
@ -81,3 +81,9 @@ div {
|
|||||||
width: 98%;
|
width: 98%;
|
||||||
margin: 1%
|
margin: 1%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#uploadFile {
|
||||||
|
text-align: center;
|
||||||
|
font-family: rawengulk-sans;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
@ -9,10 +9,17 @@
|
|||||||
enctype = "multipart/form-data">
|
enctype = "multipart/form-data">
|
||||||
<div class="fileUpload btn">
|
<div class="fileUpload btn">
|
||||||
<span>Upload</span>
|
<span>Upload</span>
|
||||||
<input class="upload btn" type = "file" name = "file" />
|
<input id="uploadBtn" class="upload btn" type="file" name="file" />
|
||||||
</div>
|
</div>
|
||||||
|
<p id="uploadFile"></p>
|
||||||
<input class="btn" type = "submit"/>
|
<input class="btn" type = "submit"/>
|
||||||
</form>
|
</form>
|
||||||
|
<script>
|
||||||
|
document.getElementById("uploadBtn").onchange = function () {
|
||||||
|
filename = document.getElementById('uploadBtn').value.split('C:\\fakepath\\')[1];
|
||||||
|
document.getElementById("uploadFile").innerHTML= filename;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user