I have a working version of google's geo-coding tutorial: http://propertysteps.ie/site-test/geocode.htm I need to loop through a mysql database and save the co-ordinates for a numbe of addresses. I had hoped to take the geocode function call out of a onclick event: <form action="#" onsubmit="showAddress(this.address.value); return false"> Code (markup): to something like a php call like: echo "<script onload=\"showAddress($listing_address);\"> </script>"; Code (markup): That way I could put the <script onload call inside a php loop for the returned databset like so: <p>Listing address is The Hills</p> <script onload="showAddress('The Hills');"> </script> Code (markup): This doesn't seem to work anyone know why? If I can get that working, I would then be able to update the database using Ajax yes? Am I going about this the wrong way? Anyone have any ideas of advice?
Hi James, not sure if it solves all, but first catch - echo "<script onload=\"showAddress($listing_address);\"> </script>"; should be echo "<script onload=\"showAddress('$listing_address');\"> </script>"; as you want to pass string. If still nothing, can you see some error??