Dynamically Linked Drop-Down Boxes

Source Code Back to Tutorials

A very common question I see is how to link two dynamic drop-down boxes designed so that when you choose an option in the first drop-down box, the options in the second drop-down box are updated.

This is the ASP way of doing this.  This works by submitting the page to itself and checking the form values to show which state should be selected and what cities should be in the city List.

Note that you do not lose the values in the other fields during this submit because the value of each is set on loading to its submitted value.

The data for this example is coming from our Address Book example.

No Addresses Found