Posts Tagged ‘dropdown list’

Dynamic Dropdown Boxes

Sunday, July 20th, 2008

One way in which JavaScript can make your forms more user friendly is where you have multiple dropdown lists where what is a valid selection in one list is dependent on what is selected in another list. Let’s take a look at how you can use JavaScript to link two dropdown lists together so that the entries displayed in the second list are dependent on what is selected in the first list.

Dynamic Dropdown Boxes

Note that theses are dropdown lists, not combo boxes, HTML does not have a tag for generating a combo box. A combo box is a combination of a dropdown list and a text input field since your visitor can either select an entry from the list or type their own value in a combo box.