When JavaScript is called input text is deleted?
<p>Im using the following to update the Latitude and Longitude of a delivery postcode.</p>

<p>Code works perfectly except when the script is called it deletes the postcode from the input box.</p>

<p>Can someone tell me why this is?</p>

<pre><code>&lt;script type="text/javascript"&gt;
//&lt;![CDATA[
  var geo = new GClientGeocoder(); 
  function getAddress(search) {
    geo.getLocations(search, function (result)
      { 
        if (result.Status.code == G_GEO_SUCCESS) {
          var p = result.Placemark[0].Point.coordinates;
          var lat=p[1];
          var lng=p[0];
          var dcMessage = '&lt;span style="color:#990000"&gt;Post Code Successfully GeoCoded&lt;/span&gt;'
          var dcHiddenOutput = '&lt;input type="hidden" name="lat" value="' +lat+ '"&gt;&lt;input type="hidden" name="lng" value="' +lng+ '"&gt;';
          document.getElementById("ConfirmOrder").innerHTML += dcMessage;
          document.getElementById("UpdateGeo").innerHTML += dcHiddenOutput;
        } 
      }
    );
  }
  function theNext() {
    var addresses = document.getElementById("myInput").value;
      getAddress(addresses);
  }
//]]&gt;
&lt;/script&gt;

&lt;form id="UpdateGeo" method="get" action="updateGeocode.asp"&gt;
&lt;input id="myInput" name="PostCode" style="text-transform:uppercase" /&gt;&amp;nbsp;
&lt;input type="checkbox"  onClick="theNext()"&gt;&amp;nbsp;
&lt;input type="submit" value="Update Database"&gt;
&lt;/form&gt;
</code></pre>
