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

tangent drupal-devel at drupal.org
Tue Jan 18 17:39:51 UTC 2005

 Project:      Drupal
 Version:      4.5.2
 Component:    base system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Kjartan
 Updated by:   tangent
 Status:       patch

The previous attached file is not a good solution. The div ID must be
unique so a class should be used instead.

If you submit a patch, use the unified option.


Previous comments:

September 2, 2003 - 05: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


September 4, 2003 - 14: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=...>

[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


January 18, 2005 - 12:08 : Zed Pobre

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.

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

More information about the drupal-devel mailing list