Skip to content

Instantly share code, notes, and snippets.

@trumball
Created September 26, 2013 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trumball/6718333 to your computer and use it in GitHub Desktop.
Save trumball/6718333 to your computer and use it in GitHub Desktop.
Here is a simple yet powerful code to create a form where the user can enter his location to get directions to a specific place. Very useful for contact pages.
<form action="http://maps.google.com/maps" method="get" target="_blank">
<label for="saddr">Enter your location</label>
<input type="text" name="saddr" />
<input type="hidden" name="daddr" value="350 5th Ave New York, NY 10018 (Empire State Building)" />
<input type="submit" value="Get directions" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment