From b813e8023225abf80db1620c1f8e8fe80d3113f8 Mon Sep 17 00:00:00 2001 From: lukas Date: Fri, 17 Jan 2025 02:38:20 +0100 Subject: [PATCH] update sample prep intake to work like it should. --- sample_prep_protocol.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sample_prep_protocol.html b/sample_prep_protocol.html index fe0b2d1..84ed618 100644 --- a/sample_prep_protocol.html +++ b/sample_prep_protocol.html @@ -7,7 +7,7 @@
-
+
- +
@@ -97,8 +97,12 @@ db = openRequest.result; // continue working with database using db object }; - function add(e){ - e.preventDefault(); + + const form = document.getElementById("sample"); + form.addEventListener("submit", add); + + + function add(event){ let prep_protocol = { "name" : document.getElementById("name").value, "Sample_Size" : document.getElementById("Sample_Size").value, @@ -116,6 +120,8 @@ console.log("something went wrong"); // Don't forget to handle errors! }; + event.preventDefault(); + return false; }