Rather than using an event to check, you should check when the form submits. Here it is step by step:
- When user selects a place, store the place AND the text value of the input
- When the form submits, check if the value of the input is the same as what you saved
- If it is different, or if there is no place saved, then perform a manual places request
Demo: http://jsfiddle.net/robertdodd/FSRd8/7/
I put together a small demo above. What I did is attach a validation method to the form. This method will check the data before submitting the form, and if required perform a manual lookup first.
function validateForm() {
searchfield = $('#searchfield').val();
if (searchfield == "" || searchfield == null) {
// No text entered
} else if (place && searchfield == placesearch) {
// Success
return true;
} else {
// place info and search text do not match, perform manual lookup
// when lookup is complete, the callback function will store the place info
// and resubmit the form
}
return false;
}
This is just an outline of what happens, all the code is in the demo if you wish to see it.
I hope this helps you!