autocomplete for cities dropdown

We have created an autocomplete input in a form where cities are loaded from an external database. The input works fine and shows all options of the cities from our database the way it should. Only problem is that on preview or publish, the city selected is forgotten by the code and its not loaded again in any way. 

Have even tried to implement Autocomplete_facebook_style plugin in the same place but exact same problem there as well. 

When we change the input type to text, we can easily store the information. Having autocomplete work here is just a lot more charming.

Please help.

  • Are you binding to the submit event on the form and then setting the value in a hidden input? I'm not familiar with the autocomplete code but that is certainly one way to do this. I assume you have already stopped the submission process by returning false and then checked the form to confirm that some input field is being set through the autocomplete.