views:

213

answers:

1

I have a django html form for address information. There is standard street, city, state/province, postal code, country fields. The country field is a drop down list. How can I make the state/province field a drop down list if the selected country is united states and a free form text box if the country is anything else?

I'd prefer not to have to do a round trip to the server so probably through jquery?

A: 

Simplest way is add javascript code on page which will be catch "country" event, and then loads data in to your selectboxes.

Or you can write custom field and widget for your form(but anyway you need to add custom javascript on form page)

Saff