W3C home > Mailing lists > Public > www-validator-cvs@w3.org > April 2015

[Bug 28428] OPTION element in DATALIST element can be empty, but validator say no

From: <bugzilla@jessica.w3.org>
Date: Fri, 10 Apr 2015 16:43:21 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-28428-169-vMWRMSDcYy@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28428

Michael Benjamin <mbb448@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #2 from Michael Benjamin <mbb448@gmail.com> ---
(In reply to Michael[tm] Smith from comment #1)
> Thanks for taking time to reporting this but the validator is behaving as
> intended and correctly according to the HTML spec.
> 
> The HTML spec defines the content model of the option element with this
> requirement:
> 
> http://www.w3.org/TR/html5/forms.html#the-option-element
> "If the element has no label attribute: Text that is not inter-element
> whitespace"
> 
> See the "Content Model" subsection at the URL above.


Thank you for the response. However, I'm not sure what you're saying is
correct.

First, the language in the spec doesn't seem clear or definitive.

Second, and more importantly, all examples and tutorials from reputable sources
(including W3C) use OPTION in DATALIST without the LABEL attribute. Every
single one of these code blocks fails to pass validation.

These DATALIST examples are all meant for teaching. All fail validation.
https://www.w3.org/wiki/HTML/Elements/datalist
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
http://www.sitepoint.com/creating-autocomplete-datalist-controls/
http://www.w3schools.com/tags/tag_datalist.asp
http://www.hongkiat.com/blog/html5-datalist/
http://blog.teamtreehouse.com/creating-autocomplete-dropdowns-datalist-element

Of course, I am open to the possibility that despite all these examples, I am
still wrong. If so, please advise the correct way to write the code in the
pages above.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 10 April 2015 16:43:23 UTC

This archive was generated by hypermail 2.3.1 : Friday, 10 April 2015 16:43:23 UTC