It sounds like the issue may reside within the JavaScript source code. There are a few things you can do to make sure everything is running correctly.
1. Make sure location services are turned on within your browser.
2. Try changing the field type to text (as it will capture any value)
3. Debug your source code.
- Add some "console.log();" lines to your source code to see if position.coords.latitude/longitude is working.
- Open the browser console (F12 for most broswers) before running the script to view any logs.
If all else fails there are other resources on the web to help with JavaScript/jQuery.
Here are a couple of popular sites:
- JavaScript:
https://developer.mozilla.org/en-US/docs/Web/JavaScript- jQuery:
https://jquery.com/ Best of luck!