W3C home > Mailing lists > Public > public-html@w3.org > April 2008

Re: <input type=search> and role=search

From: Adele Peterson <adele@apple.com>
Date: Mon, 31 Mar 2008 13:04:28 -0700
Cc: Ben Boyle <benjamins.boyle@gmail.com>, HTML WG <public-html@w3.org>, public-pfwg-comments@w3.org
Message-Id: <B97A9E35-A0FF-406F-AA42-42C897C04DE9@apple.com>
To: Henri Sivonen <hsivonen@iki.fi>

Here's a description of what we added to support <input type="search">  
in Safari.  I've been meaning to write this up for the list for a  
while, so thanks for bringing this up!

- autosave attribute
	specifies a name so recent searches can be used with any search field  
with the same autosave name.
- incremental attribute
	specifies whether or not the search event should fire as the user is  
typing
- placeholder attribute (ok, actually, Safari has implemented this for  
all text fields, but it was initially introduced with input  
type="search", and authors seem to find it handy to use it for that  
field)
	specifies placeholder text (Safari shows this text in light grey)  
when the search field is empty and not focused.
- results attribute
	specifies how many recent searches are available in the recent  
searches popup (which is activated in Safari by clicking the arrow  
next to the magnifier glass icon in the search field)
- search event
	if the incremental attribute is not present, this event fires when  
the user hits enter in the search field.  Otherwise, it fires after a  
small delay when the user types in the field.

Also, I noticed that Facebook still uses <input type="search"> in  
their sub-pages- just not on the main page anymore.  A lot of  
Dashboard widgets also use this control.  They get a lot of behavior  
"for free" that they'd otherwise have to implement with JavaScript.

- Adele

On Mar 26, 2008, at 9:00 AM, Henri Sivonen wrote:

>
> On Mar 26, 2008, at 16:17, Ben Boyle wrote:
>> Interesting. Other than having the semantic type of 'search' (and
>> benefits outlined here), does it function pretty much like a text
>> input? How does it differ?
>
>
> It can have a popup of past searches. It has a DOM event for  
> performing JavaScript-based searches as the user types. (And it  
> looks like a proper search widget on Mac OS X.)
>
> http://weblogs.mozillazine.org/hyatt/archives/2004_07.html#005890
>
> P.S. Looks like Facebook.com has switched to <input type=text> since  
> I last checked.
> -- 
> Henri Sivonen
> hsivonen@iki.fi
> http://hsivonen.iki.fi/
>
>
>
Received on Tuesday, 1 April 2008 00:27:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:53 UTC