Remove inner div from forms

Public

</> CopyGet raw version
php
  1. /**
  2. * Implements theme_form()
  3. *
  4. * Remove inner div from forms
  5. */
  6. function YOUR-THEME_form($variables) {
  7. $element = $variables['element'];
  8. if (isset($element['#action'])) {
  9. $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
  10. }
  11. element_set_attributes($element, array('method', 'id'));
  12. if (empty($element['#attributes']['accept-charset'])) {
  13. $element['#attributes']['accept-charset'] = "UTF-8";
  14. }
  15. // Anonymous DIV to satisfy XHTML compliance.
  16. return '<form' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</form>';
  17. }

Comments

Daniel's picture

I could kiss the author. I just spent 3 hours figuring out where the damn thing was coming from, and now I don't have to spend another 3 hours figuring out how to override it. Cheers, Stora.