Created
November 27, 2023 10:48
-
-
Save LaxusCroco/3ad3216e3f79f4d428c7da20f1e3345c to your computer and use it in GitHub Desktop.
Display the uploaded Media file name with global macros of JetFormBuilder. Replace s_cv with the Media field name and uploaded_cv with an element ID, under which the Media field name should be shown
This file contains hidden or 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
<script> | |
document.addEventListener('DOMContentLoaded', function () { | |
const fileInput = document.querySelector('#s_cv'); | |
const outputPara = document.querySelector('#uploaded_cv'); | |
fileInput.addEventListener('change', function () { | |
if (this.files.length > 0) { | |
let fileNames = Array.from(this.files).map(file => file.name).join(', '); | |
outputPara.innerHTML = '<b>Uploaded CVs:</b> ' + fileNames; | |
} else { | |
outputPara.innerHTML = 'No files selected'; | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment