Capture User Location while adding a new entry/submit button

**I am on the beta version 6.0.5. I need to capture the User location while he submits a record. **
In other platform I had used following startup script where “lat” and “longi” are latitude and longitude fields in my database.

$(document).ready(function(){
$("#x_lat").hide() ;
$("#x_longi").hide() ;
});

function success(position) {
var lat = position.coords.latitude;
var longt = position.coords.longitude;
$("#x_lat").val(lat);
$("#x_longi").val(longt);
};

function error() {
$("#x_lat").val("");
$("#x_longi").val("");
};
navigator.geolocation.getCurrentPosition(success, error);

Hello check [this article](Capture browser GPS coordinates in AddPage) it is radvue but still may help.

@superduperglobal your code is correct if you are trying to add this in a vue rad project or noderad or whichever! we dont have jquery selectors there! so you will replace the
$("#x_lat").val(lat); codes with the v-modelvalues of the app like this
this.vmodel = long where vmodel is the values of the vmodel of field you want