Is this the kind of thing you are looking to do ??
As you change the selections, the fields to the right change accordingly - is that what you wanted ??
By all means look at (and rip off !) the source code.
Basically what I did here was to query the database and return all of the values.
Heres the messy bit - the arrays are unknown at development time - IE I dont know how many Contact Types there will be, and for each Contact Type how many Countries there will be, and for each Country, how many Cities there will be.
So, the JS functions create dynamically named arrays (yuck - a nightmare to document and debug !)
The arrays are then used to populate the <option> tags of the 3 <selects>; and I use onChange to re-populate the <option> tags of the successive <select> tags.
Not pretty, but it does work - and I'm pretty pleased with it. If you want to know more about this, let me know.