Hi,
I have an asp.net website using a masterpage and content pages off
that.
The page I have, has the code below.
I have 2 ASP:TextBoxes which I want to populate with the lat/lng from
the click. How can I update them as the code below doesnt work and
numerous other versions Ive seen do not work either. (I've tried
innerhtml, innettext, .value and using the formname.txtLat etc)
if I use a div or html control with no runat then it works fine, but
the runat seems to prevent it working.
How do I do it?
<script language="javascript" type="text/javascript">
function initialize()
{
map = new GMap(document.getElementById("map_canvas"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(54.5, -4), 5);
GEvent.addListener(map, 'click', function(overlay,
point)
{
if (overlay)
{
map.removeOverlay(overlay);
}
else if (point)
{
document.getElementById("txtLat").innerText =
point.x;
document.getElementById("txtLng").innerText =
point.x;
map.addOverlay(new GMarker(point));
}
});
}
onload = function()
{
initialize();
}
onunload = function()
{
GUnload();
}
</script>
<asp:TextBox runat="server" ID="txtLat"></asp:TextBox>
<asp:TextBox runat="server" ID="txtLng"></asp:TextBox>
<div id="map_canvas" style="width: 295px; height: 350px;" ></
div>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
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-API?hl=en
-~----------~----~----~----~------~----~------~--~---