The poll.module is using the wrong "for" value in the label tag that is applied on the poll's title:

<div class="form-item">
<label for="choice">Internet or internet?:</label><br />
<label class="option"><input type="radio" class="form-radio" name="edit[choice]" value="0" /> "the Internet"</label><br />
<label class="option"><input type="radio" class="form-radio" name="edit[choice]" value="1" /> "internet"</label><br />
<label class="option"><input type="radio" class="form-radio" name="edit[choice]" value="2" /> "Google"</label><br />
<label class="option"><input type="radio" class="form-radio" name="edit[choice]" value="3" /> "the EZONE!"</label><br />
</div>

This is causing the Xtemplate system to fail XHTML Strict 1.0 validation (as it is defined in the builtin templates).

CommentFileSizeAuthor
#1 drupal_60820 bytesBèr Kessels
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bèr Kessels’s picture

FileSize
820 bytes

The problem is not so much the poll, but form_radios(). in general

From [1] "Each LABEL element is associated with exactly one form control."

and

"for = idref [CS]
This attribute explicitly associates the label being defined with another control. When present, the value of this attribute must be the same as the value of the id attribute of some other control in the same document. When absent, the label being defined is associated with the element's contents."

both are not met when usinf form radio's, since there are more than one element. But since the validator does not mind having a label element with all the radios (maybe he sees them as one), simply removing the for= from the from_radios.
Adding an id="" to each form radio doesn not make sense, since all would need a different id.

[1] http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.9.1

Bèr Kessels’s picture

Dries’s picture

Committed to HEAD. Thanks Ber.

Anonymous’s picture