Form in a Block

Drupal 7 Form in a Block or Node w/ PHP

A simple Drupal 7 Form in a Block example.

  • w/ basic form function
  • w/ validation and submission functions
  • errors return to the block area itself as well
  • note: Drupal 7 Form API ref
  • to remove error message from appearing w/in the element; remove the 2nd line w/ $temperrors and the following IF statement that uses it.

Alright Boys! Paste this PHP code into your block to get started:

Subscribe to Form in a Block