aboutsummaryrefslogtreecommitdiff
path: root/app/static/file.js
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2025-07-25 16:37:37 +0200
committerKaran Jayachandra <mail@karanjayachandra.com>2025-07-25 16:37:37 +0200
commit7e480ec648941355c0373197120e81721bc57dd3 (patch)
tree6ab2b7a9faebc5707df140453cef66d95494ad4a /app/static/file.js
parentc37b96a254c3a88582e4507ea180d63ce65c9af0 (diff)
parent38f099ae6ec7e7ae7338402a03654ee6378e4274 (diff)
Merge branch 'develop' into 'main'
Develop See merge request KaranJayachandra/match_up!19
Diffstat (limited to 'app/static/file.js')
-rw-r--r--app/static/file.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/static/file.js b/app/static/file.js
new file mode 100644
index 0000000..403ddf6
--- /dev/null
+++ b/app/static/file.js
@@ -0,0 +1,11 @@
+window.onload = function() {
+ const fileInput = document.querySelector("#file-js input[type=file]");
+ if (fileInput !== null) {
+ fileInput.onchange = () => {
+ if (fileInput.files.length > 0) {
+ const fileName = document.querySelector("#file-js .file-name");
+ fileName.textContent = fileInput.files[0].name;
+ }
+ }
+ };
+} \ No newline at end of file