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

  • SEARCH
  • Home
  • 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 6598831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:24:23+00:00 2026-05-25T18:24:23+00:00

I want to trigger jQuery from a GMap info window. I have these code

  • 0

I want to trigger jQuery from a GMap info window. I have these code for my GMap:

var theContent = "<form action='#' method='post' onSubmit='return false;'><input type='text' name='firstname' />";
theContent += "<input type='submit' value='Save' /></form>";

var infowindow = new google.maps.InfoWindow({       
    content: theContent
});
infowindow.open( map, marker);

and these code for jQuery:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type='text/javascript'>
    $(document).ready(function() {
        $('form').bind('submit',function() {
            var str = $('form').serialize();

            $.ajax({
                type: "POST",
                url: "save.php",
                data: str,
                success: function(msg){
                    alert('Saved!');
                }
            });

            return false; //so the page won't refresh
        });
    });
</script>

The problem is, my input to the infowindow textbox isn’t saving, that’s why I think jQuery isn’t triggered inside GMap infowindow/bubble.

When I tried the form outside GMap, it works fine.

Thanks for any help!

  • 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-25T18:24:23+00:00Added an answer on May 25, 2026 at 6:24 pm

    Right now, the jQuery code is binding to the form on document ready, but not necessarily when the info window is open. Therefore, it’s possible you are binding to the form when the infowindow is not even part of the DOM, which is not possible. You need to either:

    1. Call $('form').bind(...) RIGHT AFTER infowindow.open(...) OR
    2. Change $('form').bind(...) to $('form').live(...). This will target all present and future forms on the page.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom event that I want to fire using jQuery's trigger method:
I want to trigger a hyperlink by hitting Enter using jQuery. I have the
I want to trigger a special action in the save() method of a Django
I want to send a variable from my php page to my jquery code.
I want to trigger this function, which uses the jquery's post method, when a
We have a textbox that we want to both trigger a jQuery UI datepicker,
I have the following JQuery code: jQuery(function($) { $j(.follow_btn) .click( function() { var element
I have a JQuery Mobile Multi-Page layout and I want to trigger a function
Short version: I want to trigger the Form_Load() event without making the form visible.
I have a div, containing text and a few links. I want to trigger

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.