Using activeselect with category

The activeselect module provides your Drupal site with a new kind of form element, called an 'activeselect'. An activeselect box is the same as a regular select box, except that it is linked to another 'target' element. The target can be either a regular select box, or another activeselect. When you select a new value in an activeselect, that value is instantly sent to the server (using AJAX), and the server instantly sends back a new set of options for the target, based on your selection.

The categoryi module is the first Drupal module to make use of the functionality provided by activeselect. In fact, activeselect was written specifically to improve the usability of the category module's graphical interface (although other modules can use it in the same way too).

Activeselect currently affects the following two interfaces when it is installed with category:

  • On the add / edit category form, the containeri select box becomes an activeselect, and the parenti select box becomes its target. When you select a new container, the list of parents gets updated to reflect the available parents for a category in that container.
  • On the add / edit [node type] form (where [node type] is any node type that can have categories assigned to it), some category select boxes become activeselects. The way it works is as follows: if container A is set as an allowed distant parenti by container B, and if both containers A and B have category select boxes on that form, then container A becomes an activeselect, and container B becomes its target. This is a much more complex setup, because there can be multiple activeselects on the one form; and, more importantly, because it is possible for one form element to be an activeselect, and to be the target of another activeselect. If an element is both an activeselect and a target, then this can trigger a cascade of AJAX events (which looks really cool, and which is even cooler).

Installing activeselect with category is easy: simply download activeselect, and enable it on your site. Category will immediately detect it, and your interfaces will suddenly be jazzed up with AJAX!

If you don't have activeselect, or if your browser (or your users' browsers) doesn't have adequate JavaScript support, don't fret: in this case, all activeselect-enabled elements in the category module will degrade gracefully to their less jazzy, but still usable, equivalents.

It is highly recommended that you install the activeselect module with the category module. The usability enhancements are significant, and your site's visitors will be awed and dumbstruck by what they can do with (what was previously) a simple select box.