It is working now, so long as I removed the datepicker from outside the map. This is the working code:
<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps JavaScript API v3 Example: Info Window Simple</title> <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script> <link type="text/css" href="resources/css/jquery-ui-1.8.17.datepicker.css" rel="stylesheet" /> <script type="text/javascript" src="resources/js/jquery-1.7.1.js"></script> <script type="text/javascript" src="resources/js/jquery-ui-1.8.17.datepicker.min.js"></script> <script type="text/javascript"> function initialize() { var myLatlng = new google.maps.LatLng(-25.363882,131.044922); var myOptions = { zoom: 4, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var contentString = '<div id="demo"><form id="" onsubmit="" action="" method="post"><table><td>Date: <input id="datepicker" type="text"></td></table></form></div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Datepicker test' }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addListener(infowindow, 'domready', function() { $('#datepicker').datepicker(); }); } </script> </head> <body onload="initialize()"> <div id="map_canvas"></div> </body> </html> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So, to make datepicker working inside infowindows, simply need: google.maps.event.addListener(infowindow, 'domready', function() { $('#datepicker').datepicker(); }); Nothing else. Sorry I could not provide a demo link as I don't have a host site at the moment. Everything runs on my local host. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/hNbmyyvPp4sJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
