Reusable multiple dependent dropdowns on same page

Reusable multiple dependent dropdowns on same page

Hi jQuery Community,

I am trying to create multiple dependent dropdowns on the same page I have been able to follow the following article  http://wecamefrommars.tumblr.com/post/48854835407/codeigniter-how-to-make-mysql-cascade-dropdowns successfully and have been able to get one set of dependent dropdowns work on a page however I wish to have multiple dependent dropdowns on the same page.

Currently when I have multiple dependent dropdowns on the same page when I change the first dropdown all the dependent dropdowns in the following set change.

What I wish to achieve is being able to add multiple different addresses on the same page.

I would also like to factor this code into a reusable function that I can use anywhere on my site.

I would appreciate any help I can get in relation to this.

I am trying to make the dropdowns into an array in HTML and not sure how I can determine the id in the array of the dropdown that I make a change to so that the 2nd dropdown relating to this id will only be changed.

Please advise.