1

To be honest, I'm not sure if cascading is the right term, and if it's not then this can just be edited in the future for clarity.

I need a taxonomy term widget that is a drop-down list, and all that is initially populated are the top-level taxonomy terms in the particular vocabulary associated with the widget. After selecting a top-level term, another drop-down list is added next to the previous (the one you just selected from) with all of the children of the selected term. The parent drop-down list is then disabled.

You should be able to click a link to go "up a level", basically removing the right-most drop-down list at the time and re-enabling the right-most list after that.

For example, say I have the following structure:

  • A
    • AA
    • AB
    • AC
  • B
    • BA
    • BB
    • BC
  • C

The initial drop-down list would just contain: A, B, and C. You now select 'A'. The list with A, B, and C would then become disabled, and another list would be added directly to the right of it with the terms: AA, AB, and AC.

The term submitted along with the form would be the term represented by the right-most disabled list's selection at the time.

Is there anything that exists with this functionality (or similar)? If so, I haven't seen it (and I'm looking hard). Otherwise I guess I'll just have to code it up myself, but I'm hoping I don't have to invent a new wheel.

3

You can use the Hierarchical Select module:

This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select items in a hierarchy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.