[development] Inserting fields into a form

Jerad Bitner sirkitree at gmail.com
Mon Sep 7 02:07:09 UTC 2009

Look at '#weight'

On Sun, Sep 6, 2009 at 6:54 PM, Jeff Greenberg <jeff at ayendesigns.com> wrote:

> I'm hooking hook_form_MY_FORM_ID_alter in order to add additional fields to
> the form. The current fields have associative keys ('name', 'mail'). How do
> I add fields between them? There isn't a PHP call to do an insert into the
> middle of an array, and while using array_splice works, it won't use
> associative keys. The numeric keys result in the form looking ok, but when I
> ask the CAPTCHA module to give me a link on the form, it puts it right
> between the first field (associative key) and the first that I inserted
> (numeric key), which I think has something to do with the key problem. Is
> there an api call I've missed to let me specify where to add fields, or do I
> have to rebuild the form array in order to do it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090906/2ff0b221/attachment.htm>

More information about the development mailing list