Hi, I have looked hard for an answer to this without success.

I am writing a small function that takes the value of a text field,
and attempts to use the geocoder to validate it as an address.
Alerting the user if the address is unknown.

My problem is that it works fine if the input text field and
submission button are not inbetween <form> tags. But as soon as I add
the form tags it no longer works.

Please could someone advise on why this is. Here is the basics of the
function:

<script type='text/javascript'>

function checkGoogleAddress() {
        var address = document.getElementById('address');
        var geocoder = new GClientGeocoder();
        geocoder.getLatLng(address.value+" UK",
                function(point) {
                        if (!point) {
                                alert(address.value + ' not found on Google 
maps. Please re-enter
or leave blank');
                                return false;
                                }
                }
        );
}
</script>

<input type='text' id='address' size='30'>
<input type='Submit' value='Add event' onclick="checkGoogleAddress
()">



So if I add <form></form> around the inputs, it no longer works.
Please help. Thanks.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to