List Info

Thread: javascript ids of cck fields




javascript ids of cck fields
user name
2006-09-29 16:46:20
I have just written a small module "form_enabler",
which
enables/disables form fields in dependency of a checkbox.
http://drupal.
org/project/form_enabler

I integrated this with the CCK, however I need the
javascript ids of all
target fields (= fields that depend of a checkbox). I
couldn't find a
simple way to get these IDs.

So I wrote a function (form_enabler_form_get_ids()), which
works similar
like form_builder(). It builds all #parents, processes the
form
(#process), sets the #id like form_builder() would do and
returns an
array of ids for me. This is called during
hook_form_alter().

This does already work, but the actual question I have is:
Can this be done easier? Have I missed anything?

-fago

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )