From 9521c281602974950173a78b15285f1d0c9922ef Mon Sep 17 00:00:00 2001
From: Lene Wasskog <lene.wasskog@nibio.no>
Date: Tue, 29 Oct 2024 14:45:52 +0100
Subject: [PATCH] log: Add debug logging

---
 .../cerealblotchmodels/barleynetblotchform.html        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html b/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
index a347a492..87659ef7 100755
--- a/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
+++ b/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
@@ -215,6 +215,8 @@
 	const theForm = document.getElementById("{{ form_id }}");
 	const inputLatitudeElement = document.getElementById("latitude");
 	const inputLongitudeElement = document.getElementById("longitude");
+	const radioGrid = document.getElementById("grid")
+	const radioWeatherstation = document.getElementById("weatherstation")
 	const selectWeatherstationElement = document.getElementById("weatherStationId");
 	let poiIdList = []
 
@@ -315,13 +317,15 @@
 	}
 
 	window.displayWeatherstationInput = () => {
-		document.getElementById("weatherstation").checked = true;
+		radioWeatherstation.checked = true;
+		console.error("Check radioWeatherstation!")
 		document.getElementById('input-weatherstation').style.display="block";
 		document.getElementById('input-coordinates').style.display="none";
 	}
 
 	window.displayCoordinatesInput = () => {
-		document.getElementById("grid").checked = true;
+		radioGrid.checked = true;
+		console.error("Check radioGrid!")
 		document.getElementById('input-weatherstation').style.display="none";
 		document.getElementById('input-coordinates').style.display="block";
 		getTimezoneForSelectedPoint()
@@ -612,6 +616,7 @@
 
 			var userSettings = getLocalSettings(getNameSpaced("{{ form_id }}",formFields), false);
 			if(!isDictEmpty(userSettings)) {
+				console.error("Found previously stored usersettings", userSettings);
 				renderUserSettings(userSettings);
 				if(theForm["weatherDataSourceType"].value == "grid") {
 					displayCoordinatesInput();
@@ -621,6 +626,7 @@
 					displayCoordinatesInput();
 				}
 			} else {
+				console.error("Found no previously stored usersettings");
 				displayCoordinatesInput();
 			}
 		}).catch(function(error) {
-- 
GitLab