From 8284ebe14f60cd6c2858b802839392c0c6da0edd Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 16 Nov 2022 05:03:16 +0300 Subject: ui: provide error messaging if file is not selected. --- qc_app/static/js/upload_progress.js | 2 ++ qc_app/templates/index.html | 3 +++ 2 files changed, 5 insertions(+) (limited to 'qc_app') diff --git a/qc_app/static/js/upload_progress.js b/qc_app/static/js/upload_progress.js index fdcbe68..049dbfe 100644 --- a/qc_app/static/js/upload_progress.js +++ b/qc_app/static/js/upload_progress.js @@ -75,6 +75,8 @@ function upload_data(event) { if(the_file === undefined) { form.querySelector("#file_upload").parentElement.setAttribute( "class", "invalid-input"); + form.querySelector("#no-file-error").setAttribute( + "style", "display: block;"); return false; } pindicator.setAttribute("class", "modal"); diff --git a/qc_app/templates/index.html b/qc_app/templates/index.html index 74e4694..9111af0 100644 --- a/qc_app/templates/index.html +++ b/qc_app/templates/index.html @@ -33,6 +33,9 @@