PHP 'beating' javascript function call?
<p>I've got a bit of a weird problem. </p>

<p>I'm creating a location based web app that is using a javascript function to get a user's GPS coordinates. I have a form with a submit button, and when that submit button is clicked, the function is called (onclick='getCoords()"). The javascript then sets that values of two hidden fields (latitude and longitude) to the GPS coords. </p>

<p>My issue is this: PHP is 'beating' the javascript in the sense that the field values aren't being set in time, so that each value becomes a 0. I've done a bunch of testing, and this is definitely the issue. If I do something like set a seperate button to run the javascript function, the run the form everything works fine.</p>

<p>Any ideas on how to solve this problem?</p>

<p>Gists: </p>

<p><a href="https://gist.github.com/2425419" rel="nofollow">https://gist.github.com/2425419</a></p>

<p><a href="https://gist.github.com/2425394" rel="nofollow">https://gist.github.com/2425394</a></p>

<p><a href="https://gist.github.com/2425391" rel="nofollow">https://gist.github.com/2425391</a></p>
