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

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


-----BEGIN PGP SIGNED MESSAGE-----
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
http://mattwarden.com


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

iD8DBQFC7kv6AQ0d4HGyPE8RAnYNAJ44TK7WoTdzw4LQ/r8cYcnJJLrFyACeL26i
44TxHpcIWwn/yDc9h4RKOzc=
=cLbn
-----END PGP SIGNATURE-----


More information about the horde mailing list