[development] Activeselect - AJAX select boxes
jazepstein at gmail.com
Thu Mar 16 12:18:51 UTC 2006
The activeselect module is a new addition to Drupal contrib, that
defines a new type of select form element. Each activeselect element
has one or more 'targets' defined: the targets are other form elements
- either regular select boxes, or other activeselect boxes. When the
user selects a new option in an activeselect element, their selection
is immediately sent back to the server (using AJAX), and the server
sends back a list of new options with which to populate the 'target'
The activeselect module is here: http://drupal.org/node/49976
I am posting this message here, because I think that this kind of
functionality could be of immense benefit in many of the UIs in Drupal
contrib (and possibly even Drupal core). Activeselect is so far only
being used by the category module (http://drupal.org/node/39683), but
it has been designed with reusability in mind. It is a component that
can increase the usability of complex forms, and if used properly, it
can degrade gracefully.
I would like to encourage all module developers to consider any user
interfaces in your modules that could benefit from select boxes linked
by AJAX, and to make use of the activeselect module if appropriate.
How you integrate activeselect into a module is completely up to you.
All it does is provide the framework and the necessary JS library: the
real power of this module depends on what an activeselect callback
function is programmed to do. In the case of the category module, it
is quite significant.
Instructions for developers have now been written, and can be found in
the API.txt file included with the activeselect module. These
instructions tell you everything you need to know, to start making use
of activeselect elements in your module's forms.
The module is still quite new, and although it has been thoroughly
tested and it functions correctly (in IE and Gecko/FF - feedback on
other browsers appreciated), it definitely still has some rough edges.
In particular, the code could probably be a bit cleaner than it is
(especially in the category module's callback implementation). Please
file any and all issues through the issue tracker on drupal.org.
More information about the development