HTML 5 datalist. Have it now. Have it better.
Regards ♨ – Minimul
Current implementation of HTML 5 datalist. Hurting, but idea is right.
The HTML 5 datalist is a much needed form element. What it basically does is provides two input points for one form element. One input point is of course the mouse, as with the current HTML select tag. The second input point being the keyboard in the form of autocomplete to find a element in the list. I say much needed because I think it is important to give a user two ways to select an item from a pre-defined data list. Autocomplete, although, more efficient of the two is not always intuitive for the "non-power-user". Not only that, even power users, will sometimes favor mouse selecting from a list if they are browsing with one hand or already performing a mouse action.
Problems with HTML 5 datalist as it currently stands
- Doesn't seem high on the list of HTML 5 elements being implemented by different browser vendors. Currently only Opera supports datalist.
- Autocomplete needs to search and find within the any part of a string not just the first characters. This is especially useful for large datasets. Actually, I don't know much about how autocomplete is supposed to implemented via the spec. Currently, Opera displays the entire list no matter what is keyed in. :P
- Where is the dropdown arrow? There is no visual indicator that clicking on the element will render the list.
- Would be nice to define datalist with JSON rather than current datalist tag soup. Same issue with rendering HTML select element where you have a sea of <option> tags.
- Need to be able to disable the mouse click for displaying datasets too large. For large datasets displaying a huge list is bad for usability. Mouse selecting could take 15 to 20 seconds to find an item in a dataset over, say, a thousand entries. Be able to enforce only autocomplete in these scenarios.
HTML 5 datalist in its current implementation by Opera is barely useful to the point of being meaningless. However, the idea of two input points for a HTML form element is a worthy one.
The anecdote to the sickly HTML 5 datalist: Datalist class.
Born out my need on some client work to provide a dual input form element I created the Datalist class. I created the initial version probably about 4 years ago. Since then I have loving curated it and all features and options come out of real world web application usage. The Datalist class requires Prototype 1.6.1 and latest Scriptaculous (just effects.js and controls.js).
Screenshots of Datalist class.
Quick start guide
Here are the basics for getting the Datalist class up and running locally. Clone the code from http://github.com/minimul/datalist. Then take the following HTML snippet and save it inside the root folder of the downloaded code calling it test.html.
Ok, Christian. Enough. Let me see the demo page.
This will get you up and running with a example that is similar to the screenshots up above. Moreover, in the source code is the demo page, which is index.html. There are also a rich set of options detailed in the Datalist documentation page.