2025-01-16 03:27:00 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<header>
|
|
|
|
|
<link href="bootstrap-5.0.2-dist/css/bootstrap.min.css" rel="stylesheet" ></link>
|
|
|
|
|
<script src="bootstrap-5.0.2-dist/js/bootstrap.bundle.min.js" ></script>
|
2025-01-23 14:18:10 +01:00
|
|
|
<meta charset="utf-8">
|
2025-01-16 03:27:00 +01:00
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
2025-01-17 02:38:20 +01:00
|
|
|
<form class="needs-validation" id = "sample">
|
2025-01-16 03:27:00 +01:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col">
|
|
|
|
|
<label class = "form-label" for="name">
|
|
|
|
|
Name of Preparation Protocol
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<input class="form-control" type="text" name="name" id = "name"
|
|
|
|
|
placeholder="e.g. my favourite protocol">
|
|
|
|
|
</input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<label class="form-label" for="sample_size">
|
|
|
|
|
Sample size [uL]
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<input class="form-control" type="number"
|
|
|
|
|
id = "Sample_Size" name="sample_size" value=40>
|
|
|
|
|
</input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<label class = "form-label" for="main_dilution">
|
|
|
|
|
Main dilution
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
2025-01-17 02:42:25 +01:00
|
|
|
<input class="form-control" type="text" id = "Main_Dilution" name="main_dilution"
|
2025-01-16 03:27:00 +01:00
|
|
|
placeholder="e.g. 1:5">
|
|
|
|
|
</input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<label class = "form-label" for="setteling_time">
|
|
|
|
|
Setteling time [s]
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<input class="form-control" type="number" id="Setteling_Time"
|
|
|
|
|
name="setteling_time" value=15>
|
|
|
|
|
</input>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<label class="form-label" for="prep-notes">
|
|
|
|
|
Notes
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<textarea class="form-control" name="prep-notes" id="Prep_Notes"
|
|
|
|
|
placeholder="Notes about the preparation"
|
|
|
|
|
rows="1" cols="60">
|
|
|
|
|
</textarea>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-01-17 02:38:20 +01:00
|
|
|
<button class="btn btn-primary float-end" type="submit">submit</button>
|
2025-01-16 03:27:00 +01:00
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
var db;
|
|
|
|
|
let openRequest = indexedDB.open("my_db");
|
|
|
|
|
|
|
|
|
|
openRequest.onerror = function() {
|
|
|
|
|
console.error("Error", openRequest.error);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
openRequest.onsuccess = function() {
|
|
|
|
|
db = openRequest.result;
|
|
|
|
|
// continue working with database using db object
|
|
|
|
|
};
|
2025-01-17 02:38:20 +01:00
|
|
|
|
|
|
|
|
const form = document.getElementById("sample");
|
|
|
|
|
form.addEventListener("submit", add);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function add(event){
|
2025-01-17 03:43:54 +01:00
|
|
|
|
2025-01-16 03:27:00 +01:00
|
|
|
let prep_protocol = {
|
|
|
|
|
"name" : document.getElementById("name").value,
|
|
|
|
|
"Sample_Size" : document.getElementById("Sample_Size").value,
|
2025-01-17 02:42:25 +01:00
|
|
|
"Main_Dilution" : document.getElementById("Main_Dilution").value,
|
2025-01-16 03:27:00 +01:00
|
|
|
"Setteling_Time" : document.getElementById("Setteling_Time").value,
|
|
|
|
|
"Prep_Notes" : document.getElementById("Prep_Notes").value
|
|
|
|
|
}
|
|
|
|
|
let transaction = db.transaction(["prep_protocol"], "readwrite");
|
|
|
|
|
let objectStore = transaction.objectStore("prep_protocol");
|
|
|
|
|
let add_request = objectStore.add(prep_protocol); // (3)
|
|
|
|
|
|
|
|
|
|
transaction.oncomplete = (event) => {
|
|
|
|
|
console.log("All done!");
|
|
|
|
|
};
|
|
|
|
|
transaction.onerror = (event) => {
|
|
|
|
|
console.log("something went wrong");
|
|
|
|
|
// Don't forget to handle errors!
|
|
|
|
|
};
|
2025-01-17 02:38:20 +01:00
|
|
|
event.preventDefault();
|
2025-01-16 03:27:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</html>
|