We recently implemented Google Autocomplete for Addresses on our checkout page to simplify the process of entering a shipping address. Autocomplete is a fantastic service that makes address entry faster and error free … well, almost error free. While address typos are less frequent, addresses are failing our validation process because street number is missing.
Fortunately, we won’t let a little bug stop us from providing a great feature! We developed a workaround (admittedly a hack) that grabs the street address (including street number) from the autocomplete field (lines 40–50):
Basically, we grab the full text of the autocomplete result and consider everything up to the first comma the street address.
The script may take some massaging for your specific scenario and form, but if you are only after the full street address, using the autocompleted input may be a good workaround. To extract the street_number from the input value would take a little RegEx and understanding of country-specific address formatting.
Don’t forget to head over to the bug report and add your vote. I’d much rather see this post become irrelevant and have a proper fix!
Enjoy! Feedback welcome.