From 64d832fb49d8ef3799290ec5bd67c69c2c87e5d6 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 28 May 2020 09:52:54 -0500 Subject: Fix submit button Fixes: https://github.com/arvados/bh20-seq-resource/issues/59 --- bh20simplewebuploader/static/main.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bh20simplewebuploader/static') 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; + } } -- cgit v1.2.3