Find Out Form ID Easily with Get Form ID Module for Drupal 7

02 May · by Tim Kamanin · 1 min read

"How to find form id in Drupal" is one of the most popular questions, especially for the beginners. More experienced developers know that to find form id you need to either look into the DOM source code or to create your own hook_form_alter() function like this:

function YOUR_MODULE_NAME_form_alter(&$form, &$form_state, $form_id) {
  dpm($form_id);
}

This function will show you all form ids on the page. Being really tired of this approach, I decided to write a little module which will solve the problem once and forever. So I created Get Form ID module which is already available at drupal.org: http://drupal.org/project/get_form_id

The module adds a contextual link to every form that lets you easily find out form's ID and name of hook_form_FORM_ID_alter() hook. More details on how it works you can find in the video below:

Let me know what you think.

Comments