This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Per http://www.w3.org/TR/html/dtds.html # The label element may contain at most one descendant input element, button element, select element, or textarea element. This is not caught when validating local html. I was trying to troubleshoot a possible jQuery problem when I stumbled upon this: http://jsfiddle.net/dDJCS/ Validated local source: This document was successfully checked as XHTML 1.0 Transitional!
(In reply to comment #0) > Per http://www.w3.org/TR/html/dtds.html > # The label element may contain at most one descendant input element, button > element, select element, or textarea element. I don't see that text in the cited document. It does say "Each label must not contain more than ONE field", but that's just a comment in the DTD and not specified in a form that could be used when validating a document against the DTD. http://validator.w3.org/docs/help.html#validation_basics
http://dev.w3.org/html5/markup/label.html # The label element may contain at most one descendant input element, button element, select element, or textarea element. same concept applies to xhtml but isn't being enforced in the validator
HTML5 validation rules are very different from XHTML or HTML < 5 validation. For HTML5 the issue is caught: <!DOCTYPE html> <html> <head><title></title> <label> <input type="button" class="setNamePattern" value="1111"> <input type="button" class="setNamePattern" value="2222"> </label> </html> Line 6, Column 65: The label element may contain at most one input, button, select, textarea, or keygen descendant. Line 4, Column 11: label element with multiple labelable descendants.
(In reply to comment #3) > HTML5 validation rules are very different from XHTML or HTML < 5 validation. > > For HTML5 the issue is caught: > > <!DOCTYPE html> > <html> > <head><title></title> > <label> > <input type="button" class="setNamePattern" value="1111"> > <input type="button" class="setNamePattern" value="2222"> > </label> > </html> > > Line 6, Column 65: The label element may contain at most one input, button, > select, textarea, or keygen descendant. > Line 4, Column 11: label element with multiple labelable descendants. so are you saying that I should be able to put multiple buttons in a label?
No, comments 1 and 3 are what I'm saying.
(In reply to comment #5) > No, comments 1 and 3 are what I'm saying. If you check out the jsfiddle example you see that jquery does not work correctly. I filed a bug with jquery, they said that this is just invalid html and told me to file a bug with w3c since you guys say it is valid.