Note: This article is relevent for Classic ASP, JSP, and PHP users. ASP.NET users should read the one found in the ASP.NET section. It is also referenced at the bottom of this page.
There are situations where multiple comboboxes must be linked. When one combobox changes, the dataset of the other must change aswell.
One example would be of a Country / Province relationship. Choosing the state would necessarily repopulate the Province combobox with different data.
The first step is to wire up the first (or parent) combo to the onSelectEvent. Eg:
And our dependant combobox (the child combo) will be as follows:
Next, write a JavaScript function to perform the action:
The GetPage line tells the 2nd combo (the province combo) to requery based on the new datasource url.
Note: one key thing to understand here is that the datasource (in this case get.asp) has been written to return different datasets depending on the parameters sent to it. This aspect of it is up to you to implement. A demo is included with the trial version.