From dea47420251777d66a8d96bcbc35bc1518f9c181 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 14 Feb 2014 20:47:42 +0100 Subject: form data is saved in localstorage on pressing of printButton --- js/cctv-control.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/cctv-control.js b/js/cctv-control.js index 5f18108..54d158a 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -14,7 +14,7 @@ var cam = 0; var camHost = "127.0.0.1:8080"; var controlHost = "127.0.0.1:8080"; -var formActive = 0; +var formActive = 0; //crazy errors if boolean is used here... //create event which is triggered when DOM is ready window.onDomReady = initReady; @@ -130,6 +130,15 @@ function showForm() { function hideForm() { + + //save data + localStorage.setItem("formName", document.getElementById('formName').value); + localStorage.setItem("formDate", document.getElementById('formDate').value); + localStorage.setItem("formAnalysis1", document.getElementById('formAnalysis1').value); + localStorage.setItem("formAnalysis2", document.getElementById('formAnalysis2').value); + localStorage.setItem("formAnalysis3", document.getElementById('formAnalysis3').value); + + //hide form document.getElementById("form").style.visibility = 'hidden'; formActive = 0; localStorage.setItem("formActive", formActive); -- cgit v1.2.1