diff options
author | Pjotr Prins | 2020-05-28 09:52:54 -0500 |
---|---|---|
committer | Pjotr Prins | 2020-05-28 09:52:54 -0500 |
commit | 64d832fb49d8ef3799290ec5bd67c69c2c87e5d6 (patch) | |
tree | 9fdf79d7ae648bcc061b7d5755c5e03945dc818f | |
parent | aad579f05dbfc7bacf11419a8d5ec48697471b24 (diff) | |
download | bh20-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
-rw-r--r-- | bh20simplewebuploader/static/main.js | 13 |
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; + } } |