I love this functionality but I can't implement it as the generated code is not valid XHTML 1.0 Transitional, which is what I strive to have on my site.

The two errors I get from W3Cs validator when constructing a simple feedback form are:

One:

Line 64, column 27: character "]" is not allowed in the value of attribute "for"
<label for="edit-submitted][Name">Name:</label><span class="marker">*</span><br

(this error of course pertains to all text fields and buttons using the "for" attribute)

Two:

Line 77, column 16: there is no attribute "wrap"
<textarea wrap="virtual" cols="50" rows="7" name="edit[submitted][Message]" 

i.e. The attribute wrap is not used in XHTML. Default behavior is to wrap the text; for not wrapping, the white-space attribute in CSS is used.

Perhaps there are more XHTML issues, I haven't tried everything.

Comments

ullgren’s picture

IMNHO both these problems are drupal generic.

Problem number two is all from drupal core.
As an example check the HTML code for any drupal page that have a textarea (this form I use to post the followup is a great example).
Check the form_textarea function in includes/common.inc
Your welcome to file a issue on this in the drupal core project.

The second issue is also something I would say is a Drupal core issue (atleast if we want to use the Drupal API to draw the form components it isn't much we can do to fix this).
Drupal allways uses 'edit-' + the name as the id tag.
example see form_textfield function in includes/common.inc

ullgren’s picture

CLosing this issue since the are not much I can do about these issues aslong as we want to use Drupals form API.