views:

32

answers:

1

i have 3 dropdownlistbox..

1.country 2.state 3.cities

when i am seleting country name.. as per it..state name and city name change. in that if i am changing state name then city name is changed in dropdownlist box..

using only javascript not postback of .net control.

i have faced so much problem by making array of country,states and cities..

i thought if i have list of names of countries,states and cities than how can i maintain array of it..

so help me to getout of it. and give me good javascript to get out from this problem?

thanks......

+1  A: 

Try this

var countries = [
   {
       name:'USA',
       states:[
            {
                name:'New York',
                cities:['New York','Albany',...,'Some place']
            },
            {
                name:'Florida',
                cities:['Miami','Ft Loterdale']
            }
       ]
   },
   {
        name:'Canada' ...
   }
]
Zoidberg