# Capture User Location while adding a new entry/submit button

**URL:** <https://forum.radsystems.io/t/capture-user-location-while-adding-a-new-entry-submit-button/817>\
**Category:** Questions\
**Created:** [March 29, 2022, 2:58pm UTC](https://forum.radsystems.io/t/capture-user-location-while-adding-a-new-entry-submit-button/817 "2022-03-29T14:58:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![superduperglobal](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/s/977dab/32.png) [@superduperglobal](https://forum.radsystems.io/u/superduperglobal)\
**Post date:** [March 29, 2022, 2:58pm UTC](https://forum.radsystems.io/t/capture-user-location-while-adding-a-new-entry-submit-button/817/1 "2022-03-29T14:58:20Z")

</div>

\*\*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);

---

<div class="post-metadata">

**Author:** ![ribaraki](https://forum.radsystems.io/user_avatar/forum.radsystems.io/ribaraki/32/493_2.png) [@ribaraki](https://forum.radsystems.io/u/ribaraki)\
**Post date:** [April 30, 2022, 5:47am UTC](https://forum.radsystems.io/t/capture-user-location-while-adding-a-new-entry-submit-button/817/2 "2022-04-30T05:47:04Z")

</div>

Hello check _[this article]_([Capture browser GPS coordinates in AddPage](https://forum.radsystems.io/t/capture-browser-gps-coordinates-in-addpage/840)) it is radvue but still may help.

---

<div class="post-metadata">

**Author:** ![Wahome-mutahi100](https://forum.radsystems.io/user_avatar/forum.radsystems.io/wahome-mutahi100/32/16_2.png) [@Wahome-mutahi100](https://forum.radsystems.io/u/Wahome-mutahi100)\
**Post date:** [May 2, 2022, 10:05pm UTC](https://forum.radsystems.io/t/capture-user-location-while-adding-a-new-entry-submit-button/817/3 "2022-05-02T22:05:59Z")

</div>

@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
