These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:08 pm Advanced search

Search-field with suggestions without scripting

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Search-field with suggestions without scripting

Postby matsw » Sun Dec 27, 2009 2:04 pm

Google, Wikipedia and many other sites use JavaScript to make searchsuggestions "as you type" in the search box.

This feature should be possible without scripting, only with HTML/CSS. A special searchfield, that sends every typed and every deleted character to the server and receives/displays the answer of the server.

Because this oftenly used feature is very helpful and should also be available for those users, who have Scripting deactivated (e.g. for security) or who are on machines, where they are not allowed or not able to change the settings (e.g. at school, work, and so on).
matsw
<h6>
 
Posts: 1
Joined: Sun Dec 27, 2009 1:55 pm

Postby MarcelStetter » Sat Mar 27, 2010 11:29 am

I totally agree!! This very important and very useful feature should be possible without Scripting! Only with HTML/CSS.

Because many users have Scripting deactivated or use add-ins like "NoScript". They do so because of security or other reasons. Or you are on a machine (school, university, work,...) where you are not allowed or even not able to change the settings.

Of course, not every thing, that is done with Scripts should be possible only declarative; but this very useful feature should be possible without Scripting.

PS:
It's identical with suggestion no. 1 from Joonas Linde in this thread:
5 suggestions for forms in HTML 5
http://forums.whatwg.org/viewtopic.php?t=4100
MarcelStetter
<h6>
 
Posts: 2
Joined: Sat Mar 27, 2010 10:51 am

Postby Marius.Maas » Sat Mar 27, 2010 2:58 pm

Because this is a very widely used feature (and very useful too) I support that too.

There are so many things made possible with HTML/CSS, that are very rarely used and maybe better with Scripting, but this simple thing I'm missing every time I use Wikipedia or other sites, who offer that nice feature with Scripting.

It should not be very difficult to make that possible without scripting.

Great idea! I support it!
Marius.Maas
<h6>
 
Posts: 1
Joined: Sat Mar 27, 2010 2:52 pm

Postby David_Zaun » Sun Mar 28, 2010 12:08 pm

Excellent idea! I want that too!
David_Zaun
<h6>
 
Posts: 1
Joined: Sun Mar 28, 2010 12:04 pm

Postby Gabor » Thu Aug 05, 2010 10:51 am

I totally agree with that idea. Since a very long time, I'm wanting that.
Gabor
<h6>
 
Posts: 9
Joined: Thu Aug 05, 2010 10:24 am

Postby CasparLamy » Mon Nov 29, 2010 6:37 pm

The auto-complete/search-suggestion feature is very useful and many sites are using it (Google, Wikipedia, and thousands other pages). Of course with JavaScript.

I've heard, it was on the list for HTML 5 but has been removed. I don't know why, but this is very sad.

That's my number-one-feature for HTML 5.1 or whatever name the follower will get. It would be extremely useful for many people and would give many sites better usability, accesibility and browser-independence (and of course independence of settings or add-ins like NoScript).

Please make this feature declarative in HTML 5.1 or whatever comes after HTML 5.
CasparLamy
<h6>
 
Posts: 4
Joined: Thu Nov 25, 2010 2:19 pm

Postby PhilG » Thu Dec 02, 2010 2:58 pm

I agree:
this very useful feature should be a first-priority to-do for HTML 5.1 or whatever comes after HTML 5.
PhilG
<h6>
 
Posts: 7
Joined: Thu Dec 02, 2010 2:37 pm

Postby Alan » Mon Jan 03, 2011 5:26 am

Theoretically, an attribute could be added to the input field that points to an autocomplete script on the server. It would possibly require a protocol, though, as the implementations currently vary wildly.

An additional problem would be that there wouldn't be a way for an author to tweak the behaviour and styling. That would mean the autocompletion dialog would possibly need extra pseudo-elements or pseudo-selectors in CSS and there would need to be a way to specify behavioural aspects like whether to submit on every keystroke or only after a period of inactivity (additional HTML attributes? some kind of settings file on the server like robots.txt?).

All in all this would be a lot of overhead to implement something very simple.
Alan
<h5>
 
Posts: 18
Joined: Sun Oct 31, 2010 2:16 pm
Location: Cologne, Germany

Postby CasparLamy » Wed Jan 05, 2011 9:02 pm

@Alan:

But that should be no problem, if a standard is defined, that shows the behaviour like it is widely used today: every typed character and every deleted character transmitted to the server immediately. And the server sends every response back immediately.

If you just use a standard that is now realized with Scripting, the declarative way shouldn't have much overhead.
CasparLamy
<h6>
 
Posts: 4
Joined: Thu Nov 25, 2010 2:19 pm

Postby nog_lorp » Wed Feb 23, 2011 7:09 pm

This could be done with a number of new attributes for form elements:

Code: Select all
<form idletime=100>
  <input type=text name=query autocomplete />
  <select name=type autosend>
    ...
  </select>
</form>


Should the autocomplete request path be explicitly defined by an attribute? Or should it be implicit based on the normal form action?

The format for the reply seems easy enough; it could be a JSON array of suggestions.

For greater extensibility, a suggestion could consist of "a string, or an object with a 'str' property", and an event could be fired by the form when autocomplete results were received, with bare results or additional metadata attached to objects.
nog_lorp
<h6>
 
Posts: 5
Joined: Mon May 17, 2010 8:46 am
Location: San Luis Obispo

Re: Search-field with suggestions without scripting

Postby PhilG » Tue Mar 15, 2011 7:52 am

@nog_lorp:

Yes, something like this would be very fine!
PhilG
<h6>
 
Posts: 7
Joined: Thu Dec 02, 2010 2:37 pm

Re: Search-field with suggestions without scripting

Postby macrojd » Tue Mar 15, 2011 10:17 pm

Hi guys. I'm not sure whether it was suggested or not for HTML5, but probably the reason why it wasn't developed is the enormous database and algorithms that has to be implemented to return the right information. You not only need billions and billions of possible strings stored in a database, you also need to categorize those strings to show them sorted by relevance. To establish this relevance you need previous feedbacks from users. There are only a few companies that can provide this kind of information and one of those is Google. Without Google support probably this will be impossible.
Google implemented its own API for search (http://code.google.com/apis/customsearc ... guide.html) but I'm not sure how useful and independent could be. And Google contributed before in this sense with other APIs like the Geolocation API (considered part of HTML5 by the community), that needs a big database to determine users location. But I'm not sure about the interest in participating in something like this.

JD
macrojd
<h5>
 
Posts: 16
Joined: Thu Mar 03, 2011 1:20 am
Location: Canada

Re: Search-field with suggestions without scripting

Postby PhilG » Tue Mar 15, 2011 10:48 pm

@macrojd:

I'm not an expert in those things, but if eaxtly this feature can be done with Scripting, why should a pure HTML-version be so much complicated. The HTML only has to make the logic and the search on the server could be done with any technology, same like every other database-query. If you do any search on a website (imdb.com, Wikipedia, and so on) this is possible without all the things you described. This wish is about making this possible with auto-completion. What technology, language, database, etc. is used on the server doesn't matter, it's only to have this feature without scripting on the client.

Without knowing if possible, I would suggest the following as an option that should work, even if other ideas don't work:

websites can use traditional querys (like when you search for a movie in imdb and the server sends the results) -> you send a query and receive the results.
To make this autocomplete you have to send every change (additional or deleted characters) to the server like it was a traditional query -> the server sends the results -> the browser shows them in a pop-up at the search-box. You only need to have such a HTML-element and a server that responds to it the same simple way as to traditional queries, maybe with some additions (define how much results has to be sent, etc.). This way should work the same simple way like a traditional query, only that you have (#typed letters + #deledted letters) queries. And like servers can handle traditional queries without "billions and billions of possible strings stored in a database" they sure could handle this.

Again: it's only to have an existing (and very useful) feature without browser-based scripting. Of course the server can use any technology. It don't have to be declarative on the server, only in the browser, so that it also works, when users have deactivated Scripting.

This can't be so complicated? Or am I wrong?
(I hope it's clear, what I mean, even if my english isn't that good.)
PhilG
<h6>
 
Posts: 7
Joined: Thu Dec 02, 2010 2:37 pm

Re: Search-field with suggestions without scripting

Postby macrojd » Tue Mar 15, 2011 11:03 pm

Hi PhilG. Let say your user start typing the word "car". In your database you have this possible strings:

"cars the movie"
"car insurance"
"car reparing"
"cartoon"

In order to satisfy and create a useful tool for your users you have to order the possible queries by relevance. To know what is the relevance of every string you have to have previous feedback (it will take all your like do it manually yourself). Considering that the word car triggers billions of possible combinations, without a huge database and proper algorithms operating over previous feedback you will never know what strings have to be shown to your users and the tool will be completely useless. The reason why the websites you mentioned are effective is because they have big databases behind and billions of previous queries to give relevance to every possible string. Without the support of this companies the tool won't be possible to implement (not because of the database, but mainly because of the impossibility to establish relevance and make the application useful). You will also have to consider that the relevance and the possible strings change every minute.

JD
macrojd
<h5>
 
Posts: 16
Joined: Thu Mar 03, 2011 1:20 am
Location: Canada

Re: Search-field with suggestions without scripting

Postby PhilG » Tue Mar 15, 2011 11:45 pm

Hi JD,

of course you need to have a good database with relevance-info and search-algorithms on the server. And of course this isn't a feature for a private homepage with few pages like "This is me, these are my hobbies, this is my dog,...", but for big professional sites like Wikipedia, and so on.
But:
there is no difference to today's situation, when you do this suggestion-searchfield with JavaScript. Then you need to have the same database, the same relevance-info, the same search-algorthms, the same sorting-intelligence, etc. on the browser too!

It's only to have this feature that today needs JavaScript activated in the browser, possible also without JavaScript. Because users can have Scripting deactivated for security or whatever reason. Or maybe they are on a machine, where they even can't change this setting (school, work, library, ...) The server is in control of professionals, that can do it the way, they want. But you don't have the control, what settings the user has. Of course, for things like online-games, etc. you need Scripting. But such useful basic functions like search (even with incremental suggestions) should also be availabe for users without scripting.

Big sites like Wikipedia, Google, IMDB, ... can make this feature that they're providing already today, more accessible to more users. Small sites don't need to use this feature, or they can use professional services, like they do today for providing a search box on their sites. And of course, the classic search without suggestions should be available further on.

Greetings,
Phil
PhilG
<h6>
 
Posts: 7
Joined: Thu Dec 02, 2010 2:37 pm

Next

Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 0 guests