I have the following script to get the long and lat (after prompt, and they say ok), and it populates 2 hidden fields.
What I have trying to do is get this to server side so I have use the information a db query. I have tried to use a ontextchange event, but no event is firing!
Any assistance would be great - and thanks for looking.
What I have trying to do is get this to server side so I have use the information a db query. I have tried to use a ontextchange event, but no event is firing!
Any assistance would be great - and thanks for looking.
Code:
<script>
$(document).ready(function () {
if (true) {
navigator.geolocation.getCurrentPosition(getCoords);
}
else {
}
function getCoords(position) {
$('#mobLat').val(position.coords.latitude);
$('#mobLong').val(position.coords.longitude);
}
});
</script>