i'm trying to figure out how to update a map marker for the Google Maps API. i took existing code that works correctly and tried to apply it to my solution but i haven't been able to get it to work... here is the code that works to store new markers (slightly abbreviated)...
Code:
function storeMarker() {
var getVars = "?species=" + document.getElementById("species").value
+ "&lat=" + lat;
var request = GXmlHttp.create();
//open the request to storeMarker.php on your server
request.open('GET', 'storeMarker.php' + getVars, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
//code...
}
}
request.send(null);
return false;
}
for my solution, i have the following function that is triggered by this code...
<form name="MarkerForm" onSubmit="return updateMarker()">
all of the fields are inside the form and i have confirmed the URL string is formatted correctly with the alert(); below. the updateMarker.php page has been tested independently and works correctly, but when i try to update a marker from the map API it does not update the form data or database record and does not give me any errors. any suggestions? thanks!
Code:
function updateMarker() {
var getData = "?species=" + document.getElementById("species").value
+ "&lat=" + lat;
//alert('updateMarker.php' + getData); <-- this has confirmed the URL string is formatted correctly
var request = GXmlHttp.create();
request.open('GET', 'updateMarker.php' + getData, true);
request.send(null);
return false;
}