I am using orbeon forms 4.8 and I want to get the current GPS coordinates in the orbeon form field. I tried to run the script inside the form but it is not showing anything.
I don't know xforms so well, so can anyone have any idea how I can get the current GPS coordinates in orbeon form with JavaScript?
I imagine that you're referring to using the HTML5 geolocation API to get the user's current location, and use that value to set the value of a field. For the first part, you can check this article on the geolocation API. Once you have have the location, you can set the value of a field using the ORBEON.xforms.Document.setValue()
. For more on this, see the documentation on setting values from JavaScript.