Discuss the articles posted on Dev.Opera.
By anne
Thursday, 11. October 2007, 15:03:08
An HTML5-style "Google Suggest"
This article is an exploration of some HTML5 form features - input, datalist and external data sources - along with some nifty server-side code to help create an intelligent auto-complete form field, a la Google Suggest, in very few lines of code.
( Read the article )
By lockoom
Friday, 12. October 2007, 06:50:48

I do believe that it is possibly to copy Google Suggest with new HTML5 elements but your examples unfortunately can't compete with with original GS.
If you mention Google Suggest people will compare you examples with it. And what can I say, maybe GS need "few"

lines of code more but it's far greater experience then HTML5-style.
And complexityis not that big issue as there are plenty of JS libraries with Google suggest-like functionality.
Don't understand me wrong, HTML5 is great thing but to succeed it must provide at least comparable experience to today's JS "hacks".
By anne
Monday, 15. October 2007, 08:59:54

The point not really to duplicate the user interface, but more so how you can solve the problem in a more "semamntic way" using HTML5. Styling and such would be done on top of the widget.
By FataL
Monday, 3. December 2007, 07:26:37

I just curious if
input event should be fired in case of
Paste,
Cut or any other action that can change field?
I started digging this issue while developing a widget with word counter using OUTPUT element.
Update: Ok, I see some improvements here in Opera 9.5 Beta.
Opera 9.5 Beta 1 reacts on pasting and dragging (moving) selected symbols by mouse, but
still not handle cut action. So, I think this is just a bug and it should be fixed.
I created small
test page on this issue.
Post edited Monday, 3. December 2007, 09:08:09
By anne
Monday, 10. December 2007, 11:54:55

Yeah, any kind of input has to trigger the event. Please file a bug on the cut issue.
By FataL
Monday, 10. December 2007, 17:45:48

Bug # 302395
By Akbalder
Tuesday, 18. August 2009, 07:28:15

In the HTML5 working draft (
http://www.w3.org/TR/html5/forms.html#the-datalist-element ), I can't find the data attribute of the datalist element.
Is it still in HTML5 ?
By anne
Tuesday, 18. August 2009, 07:32:31

No, it was removed. We also removed it from Opera. You have to populate the datalist element now with new option elements. To load external data you would use XMLHttpRequest.
By Akbalder
Tuesday, 18. August 2009, 08:04:12

In latest Opera build, this code functions :
<datalist id="suggest" data="?w="></datalist>
<input list="suggest" name="q" oninput="list.data='?w='+encodeURIComponent(value)"></label>
I shouln't be able to use neither
data="?w=" nor
oninput="list.data='?w='+encodeURIComponent(value)" ?
By anne
Tuesday, 18. August 2009, 08:07:57

Right, I meant in post Opera 10 builds. Sorry about that.
By Akbalder
Tuesday, 18. August 2009, 08:15:35

Thanks,
I will change my code to be ready for the future.
By Akbalder
Wednesday, 19. August 2009, 07:18:33

I modified the code to use xmlhttprequest but there is a problem :
When I add/remove options within the datalist element, the suggestions aren't updated directly.
They are only updated
- when I write another character in the input
- when the input looses and gains focus
When typing something in the input, the suggestions are always one character old.
Is it a known problem ? Is there any solution ?
By anne
Wednesday, 19. August 2009, 07:21:50

Maybe blur and then focus again? Also, please file a bug, I do not think that is known.
By Akbalder
Thursday, 20. August 2009, 07:13:18

I filled a bug report.
Bluring and focusing the input works but it isn't smooth.
For now, I will just keep the suggestion being one character too old.