W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2007

[whatwg] [wf2] datalist value and label coupling to input

From: Rikkert Koppes <rikkert@finalist.com>
Date: Wed, 21 Nov 2007 12:07:54 +0100
Message-ID: <CA1185AF60E1C448B4F815F26585EAC50104A27C@EXCHANGE.finalist.nl>
Dear all,
Suppose I have the following code snippet
<input name="pref" list="fruits">
<datalist id="fruits">
<option label="apple" value="1">
<option label="pear" value="2">
<option label="banana" value="3">

Purpose is to enable the user to either type a new fruit name or select an existing fruit number. Actually I want the list [apple,pear,banana] as suggestion list, but as I understand correctly, the suggestion in this case would be [1,2,3], the label elements are just annotations to these values. 
Is there any (proposed) solution to let the user work with the fruit names, so names are given as suggestions and a different name might be typed in, but submit the selected fruit number if one was picked from the list?
Rikkert Koppes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20071121/234ab677/attachment.htm>
Received on Wednesday, 21 November 2007 03:07:54 UTC

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