I know this post is very old, but for those who are looking for a simple solution that can be integrated in 5 minutes, here is the link: Geocomplete jQuery ...
In my case, I followed these steps:
1 - Download the plugin from here .
2 - Add the jquery.geocomplete.js or jquery.geocomplete.min.js file to the javascript folder of your project.
3. Call this file in the script tags on the html page, where you have an input field that you must autocomplete with cities: <script src='/PathToTheFile/jquery.geocomplete.js'></script>
4 - To convert an input to an autocomplete field, simply call the Geocomplete plugin in the script tags: <script> $("#IdOfTheInputField").geocomplete(); // Option 1: Call on element. $.fn.geocomplete("input"); // Option 2: Pass element as argument. </script>
<script> $("#IdOfTheInputField").geocomplete(); // Option 1: Call on element. $.fn.geocomplete("input"); // Option 2: Pass element as argument. </script>
5- You can check the complete list of options in the link above.
Hope this helps!
source share