From ba837f70632519d58ae0f3f95bfad0dbb8051fc0 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 1 Apr 2023 16:15:52 +0300 Subject: Loosung ja Baltikett --- rannak/mangud/direktor/baltikett/script.js | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 rannak/mangud/direktor/baltikett/script.js (limited to 'rannak/mangud/direktor/baltikett/script.js') 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"; +} -- cgit v1.2.3