W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] The examples of the list attribute of the input element is incorrect

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 12 Feb 2010 12:28:31 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1002121227030.29686@ps20323.dreamhostps.com>
On Wed, 6 Jan 2010, Futomi Hatano wrote:
> 
> There is a example which shows how to mark up fallback contents of the 
> datalist element.
> 
> <p>
>  <label>
>   Enter a breed:
>   <input type="text" name="breed" list="breeds">
>  </label>
>  <datalist id="breeds">
>   <label>
>    or select one from the list:
>    <select name="breed">
>     <option value=""> (none selected)
>     <option>Abyssinian
>     <option>Alpaca
>     <!-- ... -->
>    </select>
>   </label>
>  </datalist>
> </p>
> 
> I think that this example is incorrect. [...] But it does not work in 
> UAs which support the datalist element as expected (i.e. the suggests 
> are not shown.), because the option elements do not have a value 
> attribute.
>
> The spec says that a value attribute is required in the option element 
> for a suggestion. 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element

It doesn't say they have to have a value _attribute_, it says it has to 
have a value. "Value" in this context is defined:

   http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#concept-option-value

...as "The value of an option element is the value of the value attribute, 
if there is one, or the textContent of the element, if there isn't".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 12 February 2010 04:28:31 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC