-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleaddress.js
33 lines (26 loc) · 1.21 KB
/
simpleaddress.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
document.addEventListener("DOMContentLoaded", function(event) {
var showCoordinatesField = document.getElementById('Inputfield_input_coordinates');
if (typeof showCoordinatesField !== 'undefined' || showCoordinatesField !== null) {
var reqLatBox = document.getElementById('Inputfield_input_required_lat');
var reqLngBox = document.getElementById('Inputfield_input_required_lng');
//get status of showCoordinatesfield on page load
var status = showCoordinatesField.checked;
console.log(status);
if(status){
reqLatBox.parentElement.parentElement.style.display = "block";
reqLngBox.parentElement.parentElement.style.display = "block";
} else {
reqLatBox.parentElement.parentElement.style.display = "none";
reqLngBox.parentElement.parentElement.style.display = "none";
}
showCoordinatesField.addEventListener('click', function(){
if (showCoordinatesField.checked){
reqLatBox.parentElement.parentElement.style.display = "block";
reqLngBox.parentElement.parentElement.style.display = "block";
} else {
reqLatBox.parentElement.parentElement.style.display = "none";
reqLngBox.parentElement.parentElement.style.display = "none";
}
});
}
});