title: Populate input fields on form submit
body: <p>I have the following <code>HTML</code> form:</p>
  
  <pre><code>&lt;form action="http://.../index.php/timer/start_timer" class="start_timer" id="start_timer" method="post" accept-charset="utf-8"&gt;
      &lt;input type="hidden" name="shift_id" value="290"&gt;
      &lt;input type="hidden" name="latitude" id="latitude"&gt;
      &lt;input type="hidden" name="longitude" id="longitude"&gt;
      &lt;input type="submit" value="Start"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>On the <code>submit</code> button press I would like to set the values for <code>latitude</code> and <code>longitude</code> fields and the proceed with the action to my controller.</p>
  
  <p>Here is the <code>JavaScript</code> function for getting <code>lat</code> and <code>long</code>.</p>
  
  <pre><code>function startStopTimerSubmit(){
  
      navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
  
  }
  
  function foundLocation(position){
  
      var lat = position.coords.latitude;
      var long = position.coords.longitude;
      document.getElementById('latitude').value = lat;
      document.getElementById('longitude').value = long;
  
  }
  
  function noLocation()
  {
      alert('Could not find your location. Please, try again.');
  }
  </code></pre>
  
  <p>What would be the most reasonalbe way to fill the values (<code>js</code> and <code>jQuery</code> are OK) and then proceed with the logic?</p>
  
  <p>Any help or guidance is much appreciated.</p>