views:

338

answers:

2

Hi all,

In my way of learning drupal, I got stuck in this issue. I have Taxonomy vocabularies that I set as tree with each node have different depth. Now, I need to display it in select box in a way that only one select(the parent terms) at first. On change, it will fetch term's children and display another select box below it. This goes until the last term doesn't have any children.

How do I do that in drupal?

A: 

not so clear question, may be using http://api.drupal.org/api/function/taxonomy_get_tree/6 will be helpful.

[edit]

You can use the depth parameter to make sure that you only have the top level items in your first select. Then you can (through an ajax callback) get sub items using the parent parameter.

Nikit
yeah, I use taxonomy_get_tree to build my first select box. But, how do I generate the second select box based on term id on first select box?
silent
+1  A: 

I'm not sure I understand the question, but I think Hierarchical Select could help if this is a question about the UI

greggles