title: How to use onsubmit function in another(second) php file?
body: <p><strong>First php file:</strong>  </p>
  
  <pre><code> &lt;form onsubmit="showAddress(this.address.value); return false;" method="post" &gt;
      &lt;h2&gt;Enter Address&lt;/h2&gt;
          &lt;input type="number" class=" typeahead large_inputbox" name="address"  maxlength="6"/&gt; 
        &lt;input type="submit" value="Submit" class="submit" /&gt; 
   &lt;/form&gt;
  </code></pre>
  
  <p><strong>second php file:</strong></p>
  
  <pre><code>function showAddress(address) {
  var geocoder = new google.maps.Geocoder();
  geocoder.geocode( { 'address': address}, function(results, status) {
   if (status == google.maps.GeocoderStatus.OK) {
    map.setCenter(results[0].geometry.location);
    map.setMapTypeId(google.maps.MapTypeId.HYBRID);
    if (map.getZoom() &lt; 16){map.setZoom(16);}else{}
    marker.setPosition(results[0].geometry.location);
    posset = 1;
    computepos(results[0].geometry.location);
   } else {
    alert("Geocode was not successful for the following reason: " + status);
   } 
  
  });
  }
  </code></pre>
  
  <p><strong>How to use onsubmit function in another(second) php file?</strong></p>