Same name and namespace in other branches
  1. 4.7.x includes/form.inc \theme_form()
  2. 5.x includes/form.inc \theme_form()
  3. 7.x includes/form.inc \theme_form()

Format a form.

Parameters

$element: An associative array containing the properties of the element. Properties used: action, method, attributes, children

Return value

A themed HTML string representing the form.

Related topics

File

includes/form.inc, line 2192

Code

function theme_form($element) {

  // Anonymous div to satisfy XHTML compliance.
  $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
  return '<form ' . $action . ' accept-charset="UTF-8" method="' . $element['#method'] . '" id="' . $element['#id'] . '"' . drupal_attributes($element['#attributes']) . ">\n<div>" . $element['#children'] . "\n</div></form>\n";
}