HTML 5: Web Forms 2, Search, and more
In Mark's eighth roundup of HTML 5 land, he delves into the merging of Web Forms 2, which gives us fun things like:
- input type="”email”"
- input type="”url”"
- input type="”number”"
- input type="”range”"
- input type="”date”"
- input type="”time”"
- input type="”datetime”"
- input type="”week”"
- input type="”month”"
Lots of sites use Javascript to achieve this effect, but it is surprisingly difficult to get right, in part because no one can quite agree on exactly how it should work. Mozilla Firefox displays the name of your current search engine in its dedicated search box until you focus the search box, at which point it blanks out and allows you to type.
Safari’s search box is initially blank (at least on Windows), and only displays the name of your default search engine after it has received focus and lost it again.
Google Chrome’s “omnibox” displays “Type to search”, right-justified, even when the omnibox has focus, then removes it after you’ve typed a single character. Adding an <input placeholder> attribute would allow each browser on each platform to match their users’ expectations (and possibly even allow end-user customization) of how placeholder text should work for web forms.
Discussion threads: 1, 2, 3. So far, there is no consensus on whether this should be added to HTML 5, or what the markup would look like.
Comments
Be the first to write a comment
You must me logged in to write a comment.