[whatwg] Re: Suggestions: <select datalist> and the functionality of the |for| attribute.

Ian Hickson ian at hixie.ch
Wed Jul 7 09:38:07 PDT 2004


On Wed, 7 Jul 2004, Matthew Raymond wrote:
>
> I am, for the moment, withdrawing my support for my previous suggestions
> regarding various methods of selecting and hiding general markup
> (<ignore>, <fallback>, et cetera). I do, however, continue to disapprove
> of the <datalist> element

I feel I missed something somewhere. What is wrong with <datalist>?


> I therefore make the two following suggestions:
>
> A) A new property be added to select called "datalist". When this
> property is set, the <select> will not be rendered or submitted, but its
> option list can still be called by the |list| attribute we discussed in
> previous threads.

That could work, but seems like a bit of a hack. Why is it better than
<datalist>?


> B) Any <label> with a |for| attribute whose value is the ID of an <input
> type="hidden"> or <select datalist> element should be automatically hidden.

That is very hard to describe in CSS.


> As a result of the above, you could create a degradable combo box in the
> following manner:
>
> <input type="text" name="combo1" list="myList" value="default">
> <label for="myList"> or select from the list: </label>
> <select datalist name="combo1" id="myList">
>    <option>Item 1</option>
>    <option>Item 2</option>
>    <option>Item 3</option>
> </select>

What about if you want to not have the <datalist> appear in legacy UAs at
all, for example if you are just doing:

   <input type="range" list="tick-marks" name="v1" min="1">
   <input type="range" list="tick-marks" name="v2" min="1">
   <input type="range" list="tick-marks" name="v3" min="1">
   <datalist id="tick-marks">
     <option value="1">
     <option value="5">
     <option value="10">
     <option value="50">
     <option value="100">
   </datalist>

Here you don't want the list to appear in legacy UAs, in legacy UAs you
just want three text boxes.



> 2) It makes sense that labels for hidden controls should also be hidden.
> 3) This is easier to follow than the <datalist> combo box solution.

I don't know that it really is. Attributes are easy to lose in the markup,
especially when you are doing forms stuff with dozens of attributes.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list