Altering form in drupal?


Top Questions

hook_form_alter

Drupal hook function or hook_form_alter(&$form, &$form_state, $form_id)

Perform alterations before a form is rendered.

One popular use of this hook is to add form elements to the node form. When altering a node form, the node object can be accessed at $form['#node'].

Note that instead of hook_form_alter(), which is called for all forms, you can also use hook_form_FORM_ID_alter() to alter a specific form. For each module (in system weight order) the general form alter hook implementation is invoked first, then the form ID specific alter implementation is called. After all module hook implementations are invoked, the hook_form_alter() implementations from themes are invoked in the same manner.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
8 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content