[drupal-devel] [bug] form_hidden and form_submit generate invalid XML

Zed Pobre drupal-devel at drupal.org
Tue Jan 18 17:08:50 UTC 2005


 Project:      Drupal
-Version:      cvs
+Version:      4.5.2
 Component:    base system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Kjartan
 Updated by:   Zed Pobre
-Status:       active
+Status:       patch
 Attachment:   http://drupal.org/files/issues/common.diff (600 bytes)

Attached is a patch to add  encapsulation to the form_hidden and
form_submit functions in common.inc.

Zed Pobre



Previous comments:
------------------------------------------------------------------------

September 2, 2003 - 04:58 : Kjartan

form_submit() and form_hidden() don't wrap their output in a div or
similar block element, this creates problems when trying to validate
XHTML strict. Wrapping the return in a form_item(0, ....) seems to work
fine.

------------------------------------------------------------------------

September 4, 2003 - 13:58 : ax

i think it is consensus that form_* functions shouldn't be wrapped into
form_item() [1,2]. your problem would be much better fixed by adding an
inner <div> to the form() function, ie.

function form($form, ...) {
  // ...
  return '
<form action=...>
  <div>
    $form
  </div>
</form>';
}


[1] Re: [drupal-devel] XHTML validity, part II |
http://lists.drupal.org/archives/drupal-devel/2003-06/msg00172.html [1]
("PROBLEM 2: common.inc form_* functions")
[2] Re: [drupal-devel] form_* functions |
http://lists.drupal.org/archives/drupal-devel/2002-10/msg00676.html [2]
[1] http://lists.drupal.org/archives/drupal-devel/2003-06/msg00172.html
[2] http://lists.drupal.org/archives/drupal-devel/2002-10/msg00676.html


-- 
View: http://drupal.org/node/2714
Edit: http://drupal.org/project/comments/add/2714





More information about the drupal-devel mailing list