I am using http://ubilabs.github.com/geocomplete/ to have a form submit latitude & longitude. If I just do the trigger below it works and fills up lat & lng fields. However, when I add the submit jquery code, it submits blank fields. I know its some timing thing since I can see the fields fill up but not sent via POST. But I can't figure it out, any suggestions?
<script>
$(document).ready(function(){
// Area for any jQuery
$("#geocomplete").geocomplete({
details: "form",
types: ["geocode", "establishment"]
});
$("#geoform").submit(function() {
$("#geocomplete").trigger("geocode");
alert('Handler for .submit() called.');
return true;
});
});
</script>
<form id="geoform" method=post action="/foo.php">
<input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
<!--<input id="find" type="button" value="find" />-->
<input type="submit" value="Go" />
<fieldset>
<input name="lat" type="text" value="">
<input name="lng" type="text" value="">
<input name="query" type="hidden" value="true">
</fieldset>
</form>