Created
July 26, 2020 05:46
-
-
Save mohammadYousefiDev/2cb56b5e7b0c453ac26eae849cfcfa02 to your computer and use it in GitHub Desktop.
show file name when file input changed in mdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-file"> | |
<input type="file" class="form-file-input" onchange="changeFile(this.files[0].name, 'form-file-personal-text')" id="customFile" name="personal" required/> | |
<label class="form-file-label" for="customFile"> | |
<span class="form-file-text" id="form-file-personal-text">Personal Image ...</span> | |
<span class="form-file-button">Select</span> | |
</label> | |
</div> | |
<script> | |
function changeFile(filename, id) | |
{ | |
document.getElementById(id).innerHTML = filename; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment