so I want to fill field values of latitude and longitude using JavaScript. I tried document.getElementbyId method and find the input field id manually but when i cllick save it only fills the UI not the actual database. Is there any way to do this?
code:
model.py
latitude = fields.Float(string='Latitude',)
longitude = fields.Float(string='Longitude',)
script
navigator.geolocation.getCurrentPosition( successCallback, errorCallback, options );
functionsuccessCallback(position) { const { accuracy, latitude, longitude, altitude, heading, speed } = position.coords;
document.getElementById("o_field_input_13").value = latitude; document.getElementById("o_field_input_14").value = longitude;