Hi All,
I am already using the Google Maps Custom View to display users location. But now I want to capture the coordinates automatically on form submit and pass them to the Long and Lat fields in my DB. Also, I want form submission to fail if Coordinates are not captured, maybe due to user not turning GPS on.
Please, how to do this? Currently, I am using this code in Server Events -> Client Scripts -> Add Page. I am getting a location prompt but it is not passing paramaeters to my DB.
Here is my current script
function success(position) {
var lat = position.coords.latitude;
var longt = position.coords.longitude;
$("#x_lat").val(latitude);
$("#x_longt").val(longitude);
};
function error() {
$("#x_lat").val("");
$("#x_longt").val("");
};
navigator.geolocation.getCurrentPosition(success, error);