I am working on a site called earthquake damage map. It is almost finished, however I have a problem with the autocomplete function. It works fine with the search button, but I want to get rid of the search button altogether. It should query the results when I click on a result in the list but instead displays all the results appearing in the list.
<input type="text" id="search-string4" placeholder="Search by Earthquake" class="tb11" onclick="focus" oninput="doQuery()" onchange="doQuery()">
As you can see it queries the results as I type which is good but doesn’t display properly when a result is clicked in the list.
Any help would be much appreciated.
Whatever code you are calling on clicking the search button, you can move that code into select event of autocomplete as follows:
from jqueryui website,