aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader
diff options
context:
space:
mode:
authorPjotr Prins2020-05-28 09:52:54 -0500
committerPjotr Prins2020-05-28 09:52:54 -0500
commit64d832fb49d8ef3799290ec5bd67c69c2c87e5d6 (patch)
tree9fdf79d7ae648bcc061b7d5755c5e03945dc818f /bh20simplewebuploader
parentaad579f05dbfc7bacf11419a8d5ec48697471b24 (diff)
downloadbh20-seq-resource-64d832fb49d8ef3799290ec5bd67c69c2c87e5d6.tar.gz
bh20-seq-resource-64d832fb49d8ef3799290ec5bd67c69c2c87e5d6.tar.lz
bh20-seq-resource-64d832fb49d8ef3799290ec5bd67c69c2c87e5d6.zip
Fix submit button
Fixes: https://github.com/arvados/bh20-seq-resource/issues/59
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r--bh20simplewebuploader/static/main.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js
index 6707096..fba791d 100644
--- a/bh20simplewebuploader/static/main.js
+++ b/bh20simplewebuploader/static/main.js
@@ -175,7 +175,14 @@ for (let button of document.getElementsByClassName('remove-field')) {
// Change the submit button after hitting
function on_submit_button() {
- var elem = document.getElementById("submit");
- elem.value = "Submitting...";
- elem.disabled = true;
+ var f = document.getElementsByTagName('form')[0];
+ if(f.checkValidity()) {
+ var elem = document.getElementById("submit");
+ elem.value = "Submitting...";
+ elem.disabled = true;
+ f.submit();
+ } else {
+ alert(document.getElementById('example').validationMessage);
+ return false;
+ }
}