PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

beginner - call a google map with user address

  1. mgason
    Member

    Hi,
    I came across an article that described creating a form in a webpage where the user enters their address and hits submit. This then opens a new browser window at google maps with directions from their address to my location already shown.
    How can I set this up using Gravity Forms?

    the code to do it in a web page is

    <form action="http://maps.google.com/maps" method="get" target="_blank">
    Enter your starting address:
    <input type="text" name="saddr" />
    <input type="hidden" name="daddr" value="12th & C Street SW, Washington DC" />
    <input type="submit" value="get directions" />
    </form>
    Posted 13 years ago on Friday September 9, 2011 | Permalink
  2. You would configure your form to use a redirect for it's confirmation. You'd then place the google map's URL as the redirect URL and then use the query string builder to pass form data to Google Maps using the appropriate query string parameters Google wants (ex. saddr, daddr, etc.).

    Posted 13 years ago on Friday September 9, 2011 | Permalink
  3. mgason
    Member

    Thanks,
    form stuff is all greek to me, but I puzzled it out, I am amazing, or your product is really cool ;-)
    one last issue, can I have the map open in a new window like the sample code does? I could not get that to work, right now it opens in the same window. I did not want the user to navigate away from the site.

    Posted 13 years ago on Saturday September 10, 2011 | Permalink
  4. mgason
    Member

    on a different not could I ask what you use to display code on these forums?
    I like it.

    Posted 13 years ago on Sunday September 11, 2011 | Permalink
  5. You can find the JavaScript code highlighter here:
    http://code.google.com/p/syntaxhighlighter/wiki/Usage

    It's been slightly modified to work with the bbPress forums here.

    Posted 13 years ago on Tuesday September 13, 2011 | Permalink

This topic has been resolved and has been closed to new replies.