O'Reilly logo

Drupal 7 Development by Example Beginner's Guide by Kurt Madel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — using hook_form_FORM_ID_alter to modify our Webform-based contact form

The first thing we need to do in order to use this hook is to get the FORM_ID of our Webform-based contact form. The hook_form_FORM_ID_alter core hook is executed for a specific form based on the ID of the form. To find the ID of our Webform-based contact form, we will once again turn to the trusty Devel module.

  1. Open up our d7dev site in your favorite browser, click on the Find content link in the Shortcuts bar, and click on the Contact Form of TYPE Webform.
  2. Once the Webform content has loaded, click on the Devel tab.
    Time for action — using hook_form_FORM_ID_alter to modify our Webform-based contact form
  3. Next, on the DEVEL overlay, click on the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required