how to use jquery autocomplete combobox with ajax json data?
I need to do the following using a combobox.

- `Select box` has a default list of cities which the user can search from.
- If a user types in text in the `input` box, I need to make an ajax call to fetch data and display the options to the user.
- If data was fetched for user's request, those cities should be appended to the options of `Select box`

Using [jquery autocomplete][1] I am able to fetch json data on user entering a string and displaying the results. However, I am quite clueless on how to integrate this using combobox.


[Combobox][2] uses a static data array to search from and if I understand this correctly, uses regular expression to match values. However, how do I interrupt it and uses the ajax call to fetch data from server and update the results ?


  [1]: http://jqueryui.com/demos/autocomplete/#remote
  [2]: http://jqueryui.com/demos/autocomplete/#combobox
how to use jquery autocomplete combobox with ajax json data?
===

I need to do the following using a combobox.

- `Select box` has a default list of cities which the user can search from.
- If a user types in text in the `input` box, I need to make an ajax call to fetch data and display the options to the user.
- If data was fetched for user's request, those cities should be appended to the options of `Select box`

Using [jquery autocomplete][1] I am able to fetch json data on user entering a string and displaying the results. However, I am quite clueless on how to integrate this using combobox.


[Combobox][2] uses a static data array to search from and if I understand this correctly, uses regular expression to match values. However, how do I interrupt it and uses the ajax call to fetch data from server and update the results ?


  [1]: http://jqueryui.com/demos/autocomplete/#remote
  [2]: http://jqueryui.com/demos/autocomplete/#combobox