Two ways, both requiring javascript: 1. Populate the city dropdown via ajax on country change. 2. Have your template write javascript to do country->city lookups and alter the contents of the city dropdown on country change.
On Sep 19, 2:42 am, Andy <selforgani...@gmail.com> wrote: > I have a model FieldReport that has, among other fields, these two > fields: > > -country > -city > > Both "country" and "city" are lists of choices. > > I want to have a form FieldReportForm as a ModelfForm based on the > model FieldReport. I want to have "country" and "city" represented as > drop down lists. Moreover, "city" should be a dynamic list based on > the selected value of "country". > > For example, if someone selects the value "US" for "country", then > "city" should be a list of US cities only, all cities in other > countries shouldn't be loaded onto that list. > > Is this something that would work with Django's ModelForm? How would > you implement something like this? > > Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.