Advertising sustains the DA. Ads are hidden for members. Join today

Basic Form Alterations

One of the most basic things you want to know if you start digging into the code is NOT how to build an entire form from scratch or something super specific. You start with simple things like altering existing forms.

Within Forms API there are two functions that are your friends, in this regard: hook_form_alter and hook_from_FORM_ID_alter.

The child pages of this page should address basic alterations you can make to your forms using these hooks.

Redirecting a Form

Using your hook_form_alter or hook_form_FORM_ID_alter function you can redirect where a node form will go after a user submits the form.

Guide maintainers

mry4n's picture