[development] finding the $form_id of a particular form / all forms.

Jason Flatt drupal at oadae.net
Sat Jul 1 14:14:18 UTC 2006


On Saturday 01 July 2006 03:05, Augustin (a.k.a. Beginner) wrote:
> Hello,
>
> hook_form_alter() allows us to change forms according to their form_id:
> http://api.drupal.org/api/HEAD/function/hook_form_alter
>
> Am I missing something easy, or the only way to figure out what is the
> form_id of a specific form is to pour over the code and figure out which
> module initialized the said form?
> Devel.module doesn't seem to help with that.
>
> thanks,
>
> Augustin.

Heh, I hit this just yesterday. While my solution probably wasn't "correct", 
it worked for me. I just put a "print ($form_id);" as the first statement of 
my custom form_alter function, then I navigated to the form I wanted the ID 
for, and it was the first thing printed at the top of the page.

-- 
Jason Flatt
http://www.oadae.net/
Father of Six:  http://www.flattfamily.com/ (Joseph, 13; Cramer, 11; Travis, 
9; Angela; Harry, 5; and William, 12:04 am, 12-29-2005)
Linux User:     http://www.sourcemage.org/
Drupal Fanatic: http://drupal.org/


More information about the development mailing list