From dd2f70706cbf73715ec87765ef740047f65360f4 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 16 Feb 2014 03:13:55 +0100 Subject: date is displayed in form and readonly --- cam.html | 2 +- js/cctv-control.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cam.html b/cam.html index 4fec98b..3196c52 100644 --- a/cam.html +++ b/cam.html @@ -16,7 +16,7 @@

Personalkennzeichnung


Zeitpunkt

-
+

Analyse der Aufnahme

Bemerkungen zum Untersuchungsverlauf

diff --git a/js/cctv-control.js b/js/cctv-control.js index b4e6fa7..4732b30 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -131,12 +131,30 @@ function showForm() { display2 = document.getElementById("formImage"), stor = localStorage.getItem("snapShot"); + var d = new Date(); + + var date = d.getDay(); + date += '/'; + date += d.getMonth(); + date += '/'; + date += d.getFullYear(); + + var time = d.getHours(); + time += ':'; + time += d.getMinutes(); + time += ':'; + time += d.getSeconds(); + time += ' Uhr'; + //display loaded image if (stor) { display1.setAttribute("src", stor); display2.setAttribute("src", stor); } + //insert date in date-field + document.getElementById("formDate").value = date + ' ' + time; + //make form visible document.getElementById("form").style.visibility = 'visible'; formActive = 1; -- cgit v1.2.1