form

Check Form type in Drupal

Sometime you have to add condition on the basis on form type, either it is node type form or taxonomy type form.

But question is how you get the type of the form.

In Your form alter you can find form type. Here is the sample code from my module file.

if($form['#entity_type'] == 'node' || $form['#entity_type'] == 'taxonomy_term') { //when type of form is node or taxonomy
$form['actions']['submit']['#access'] = FALSE; // remove submit button from form.
}
Subscribe to RSS - form