Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6080325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:02:52+00:00 2026-05-23T11:02:52+00:00

I am using jQuery with the Google Maps API V3’s Geocoder. The site user

  • 0

I am using jQuery with the Google Maps API V3’s Geocoder. The site user enters a location in the textbox and clicks on the submit button, which calls the code below to geocode the address given by the user into LatLng coordinates.

$(function(){

$("#searchbox_form #search_button").click(function(){
    var address = $("#location").val();

    var geocoder = new google.maps.Geocoder();
    alert(address);
    geocoder.geocode( { 'address': address}, function(results, status) {
        alert("123");
        if (status == google.maps.GeocoderStatus.OK) {
            $("#user_lat").val(results[0].geometry.location.lat);
            $("#user_lng").val(results[0].geometry.location.lng);
            alert("lat: " + $("#user_lat").val());
            alert("lng: " + $("#user_lat").val());
        } else {
            alert("asdasdasd");
            alert(status);  
        }
    }); 
});

});

However there is some problem. You will notice I placed several alert()s in the code. When ‘Boston’ is entered into the textbox and the submit button is clicked, only alert("address"); is executed showing Boston but alert("123") does not run. Did something go wrong somewhere?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:02:53+00:00Added an answer on May 23, 2026 at 11:02 am

    Solution is to disable the submitting of the form 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1) I have a site, using jQuery and the gMap Google Maps plugin. This
I'm working on an advanced map application in Google Maps API V3. I'm using
I'm writing a Google Maps app that requests data from the server using jQuery's
I have found a code to show Google maps with multiple markers using JQuery
We are using Google maps API V3 and we have a set of boundries
I'm using google maps API. I use a $.getJSON on .keyup() to geocode the
I am using Google maps v3 geocoder to geocode an address then pass the
I'm using Google Maps V3 api. I am submitting an address search to return
using jquery-ui-map here is my code $(document).ready(function() {$('#map_canvas').gmap({ 'center': new google.maps.LatLng(3.162456,21.09375), 'zoom': 2, 'streetViewControl':
I am using a google map with the full maps api on my website.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.