views:

158

answers:

1

I need to do a quick and dirty 'Country' --> 'State' drop down relationship on a web form. I only am concerned with the states, provinces, and territories for USA and Canada, and this will be a relatively lightly used form, so a pure javascript solution is probably ideal.

+1  A: 

Create a JSON array:

array = [ { name: "United States", states: [...] }, { ... } ];

When the value of the dropdown changes, fill in the other drop down with the contents of the particular element from the array.

Mehrdad Afshari