I am using Address field module to populate address. A requirement needs to limit cities to a particular set, and also countries to particular set too. so I would like to present a set of cities in drop down list based on country selection. From the answer here I could figure out that something has to be done in plugins but I could not figure out what exactly. If anyone has sample code for city drop down in Address Field modules's plugins it would be of great help!
Consider using the Select (or other) module. Here is an excerpt about it from its project page.
Provides a new Forms API element which is a select/radios/checkboxes element that has an 'other' option. When 'other' is selected a textfield appears for the user to provide a custom value.
So basically you could "start" from a few cities (City 1, City 2, City 3), and whenever somebody needs another one (not in the list yet), they just enter "City 4". Here is a sample about it (just replace "Option" by "City" to get the idea):