[horde] Horde methods for conditionally populationg drop-down menus?

Matt Warden mwarden at gmail.com
Mon Aug 1 09:21:15 PDT 2005

Hash: SHA1

Kevin M. Myer wrote:
> So what I'm thinking, in theory at least, is that for each share, lookup the
> owner's categories,  Build an array with the key being the owner, and the value
> being the category.  Use Javascript (?) to toggle between the sets of arrays,
> based on what share  is chosen.  I'm looking for an easier way to do that,
> instead of writing all the Javascript and form code from scratch (although
> admittedly, not being a developer, there may be a far simpler way to do this). 
> Would Horde_Form_Action_updatefield be a proper Class to use?

If you are talking about select boxes, no,
Horde_Form_Action_updatefield doesn't look like it will work. It's
using the .value property, which will not work in non-IE browsers for
select boxes. Select boxes would be updated like:

document.getElementById('idofselectbox').selectedIndex = 3;

And to do that based on a value, you'd have to loop through the
options array, checking each option's value.

There is support for the 'assign' type, where you would get two select
boxes and are able to move options from one select box to the other,
but I cannot find anything that is like you want in the current
Horde_Form implementation.

- --
Matt Warden
Miami University
Oxford, OH, USA

This email proudly and graciously contributes to entropy.
Version: GnuPG v1.2.4 (GNU/Linux)


More information about the horde mailing list