How to alter the uc_address:city form field? I have to alter cities form field in checkout page under delivery section. I have to change it from a textfield to a select options dropdown.


I have managed to do that using a separate template file for checkout page but I
am not able to use #ajax functionality of form field
In Drupal 6 it was possible using hook_form_uc_cart_checkout_form_alter(), but in Drupal 7 the address fields are rendered in a different way, and I'm not able to alter the address form fields as desired


What are other ways of changing it?

I used hook_form_alter() with an #after_build callback; I was able to change the field from text field to select option, but the #ajax parameter attached to this is not working.

It seems like ajax callbacks are attached with the hooks at an early stage. Is there any way to have the #ajax property working?
If you are using Addressfield module you can easily do that extending the module itself.

Look into the sites/all/modules/addressfield/plugin/format &amp; you will see address.inc, where you can extend the list of region or city.

You can look for the example in sites/all/modules/addressfield/example/plugin/format to better understanding of the the format which module will accept for extending it for your list values.