Hi people i have a query.. Hopefully soeone can help
I am trying to post some geolocation data in a hidden field in my form: -
this is my form value
<input type="hidden" value="latitude" id="hiddenfield1" name="hiddenfield1" ></input>
My javascript is: -
function getLocation() {
navigator.geolocation.getCurrentPosition(onSuccess, onError, { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true });
}
var onSuccess = function(position){
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Accuracy: ' + position.coords.accuracy + '\n' +
'Timestamp: ' + new Date(position.timestamp) + '\n');
var lat = position.coords.latitude;
var lon = position.coords.longitude;
hiddenfield1.Value = lat;
};
How do i get the value of the latitude cordinates into the hidden field please