I have a search form with google autocomplete for location. If the users ignore the autocomplete or does not wait for the autofill and hits return or the submit button it returns no data because google really never found that autocomplete. I know how to stop the return but the submit button is tricky. Any suggestions?
Thanks in advance.
I have it selecting the top result with this script. But again, if they hit the search no results match cause autocomplete does not finish.
How about a variable (eg readyToSubmit) that defaults to false…When the autocomplete is ready, set the variable to true. Disable the button if readyToSubmit is false.
That would work if I was just asking for location. But if the user doesn’t put a location just keyword search it would stop the ability to search. I have seen this done on other search sites with google autocomplete. I just don’t know why this won’t add the search to the field. It works if the user returns but not submit button.