summaryrefslogtreecommitdiff
path: root/rannak/mangud/direktor/baltikett/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'rannak/mangud/direktor/baltikett/script.js')
-rw-r--r--rannak/mangud/direktor/baltikett/script.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/rannak/mangud/direktor/baltikett/script.js b/rannak/mangud/direktor/baltikett/script.js
new file mode 100644
index 0000000..f5d1016
--- /dev/null
+++ b/rannak/mangud/direktor/baltikett/script.js
@@ -0,0 +1,47 @@
+document.addEventListener('DOMContentLoaded', () => {
+ let btn = document.querySelector('.modalButton');
+ btn.click();
+});
+
+
+
+const inputs = document.querySelectorAll('input');
+let asulaVal;
+let kaugusVal;
+let teekondVal;
+
+for (input of inputs){
+ input.addEventListener('input', () => {
+ getInputs()
+ });
+}
+
+
+function getInputs(){
+ let teekond = document.querySelector('.teekondInput');
+ let asula = document.querySelector('.asulaInput');
+ let kaugus = document.querySelector('.kaugusInput');
+
+ asulaVal = asula.value;
+ kaugusVal = kaugus.value;
+ teekondVal = teekond.value;
+
+ if (asulaVal != '' && kaugusVal != '' && teekondVal != '')
+ allGood();
+}
+
+
+
+/// All Done ///
+
+
+
+function allGood(){
+ const btn = document.querySelector(".moveOn");
+ btn.disabled = false;
+ localStorage.setItem("roll", "Direktori");
+ localStorage.setItem("asula", asulaVal);
+ localStorage.setItem("kaugus", kaugusVal);
+ localStorage.setItem("teekond", teekondVal);
+ btn.onclick = () => location.href = "../../../endPage";
+}