[thelist] JavaScript and Dynamic Select Boxes

Chris Berg chris.berg at mantech.com
Thu Oct 2 09:11:05 CDT 2003


Hello all,

I am new to the list and before posting I just wanted to say that this community rocks.  I have been a reader of the articles at the site for years now, awesome stuff here.

My problem is that I am trying to come up with a bit of code to handle dynamic select boxes and (later on) a Javascript tree.  I return some data from coldfusion in the form of a query.  It resembles this:

ID	TITLE
1	Documentation
1.1	Briefs
1.2	Deficiency Reports
1.2.1	Type 1
1.2.1.1	Type 1A

The ID represents the hierarchical relationship between the entries and they can be dynamically "N" levels deep (at the moment they go up to 5 levels deep).  I would like to run one query to get all of these and then parse it al out in such a way to make the dynamic select menus on the client side.  For example, if a user selects "1" then in the next select box I only want to display sub-entries (1.1,1.2,1.3) and so on.  I don't know if this can be done as I have never been very strong in Javascript.

So my question is how could I parse all of this data out to dynamically create the select menus on the client side?

Thanks ahead of time for any help.

Chris



More information about the thelist mailing list