How to geocode a form field on submission? I'm writing a module with form alter that should geocode a text field value to the lat\lan format upon triggering the submit function. Should I use the Geocoder module for this? Are there any sample queries to learn how to perform geocoding with that module? Thanks.
Personally, rather than form_alter upon submission, I would wire up an AJAX function to fire on the address/location textfield's onchange event, which would use the Google Maps Javascript API's Geocoder function.  This would then populate a hidden text field (or two) with the lat/lng pair for form submission.

If you want to use the Geocoder module, it should probably go in the validate function so you can double check that you actually have a valid address.

Ideally, you would do both.  Doing it client side is faster, and doing it server side supports users w/o Javascript.