[support] FAPI: Elements

Metzler, David metzlerd at evergreen.edu
Fri Sep 18 17:41:58 UTC 2009


I'm not sure this needs ahah, but rather a form_alter hook to add the
form item and submit handler.  What is ahah's role here?  

Dave

-----Original Message-----
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Peter Childs
Sent: Friday, September 18, 2009 2:37 AM
To: support at drupal.org
Subject: [support] FAPI: Elements

I'm need a Form Element that I can slot into several forms in this case
for selecting location details but the theory runs for anything.

Ideally I want to AHAH enable it so that I can check and update it as
they fill the form in pro to submission.

So Far I've worked out.

Build the element in a #process callback (where previous values are in
#default_value)

Check it in a #element_validate callback (where previous values are in
$element (the first parameter) but if you need to update or add anything
change the second parameter that is passed by ref.

The only thing I've really got on using AHAH is to get the whole form to
build and work correctly without it then add it afterwards.

But I can see how I get just the element to use AHAH and then be able to
just drop it into any form later.

I've looked at most of the documentation and it seams a bit complex.

I'm using Drupal 6

Any help or guidance would be much appreciated.

Peter
--
[ Drupal support list | http://lists.drupal.org/ ]


More information about the support mailing list