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