Ian Davies wrote:[color=blue]
> I would like to get the second dropdown box to update as soon as an
> Item is selected from the first.
> I have searched the net but cannot
> find anything. It seems that this is something that is not commonly
> done.[/color]
You may not searched on the right keywords, because solutions for this are
all over the web, and it is a quite common thing to be done.
For example,
http://www.JavascriptToolbox.com/dynamicoptionlist/
[color=blue]
> The problem is this only works once when I open the page (with the
> default values).[/color]
This leads me to believe that you're firing a sql query to get the values
for the second list for only the value that is in the first list.
You have a couple of options:
1) You can fire the query every time the first box changes and populate the
second box. This will either require an ajax-like technique, or reloading
the page.
2) You can query for all possibilities when building the page, and code all
possible variations into pure javascript which will populate the second box
immediately on change of the first. This is the technique used in my url
above.
Which solution you pick depends a lot on your environment, browser support,
degradation requirements, and experience.
--
Matt Kruse
http://www.JavascriptToolbox.com http://www.AjaxToolbox.com