Labels in input fields aren’t such a good idea
laurakalbag.com
laurakalbag.com
<body>
<form>
<div class="cool-label">
<label for="name">name</label>
<input id="name" type="text" placeholder="John Doe" />
</div>
<div class="cool-label">
<label for="email">email</label>
<input id="email" type="text" placeholder="john@doe.com" />
</div>
</form>
</body>
body {
background: #eee;
}
form {
width: 250px;
margin: auto;
margin-top: 50px;
}
.cool-label {
border: 1px dotted rgba(0,0,0,.3);
background: #fff;
margin-bottom: 10px;
width: 100%;
}
.cool-label label {
width: 60px;
display: inline-block;
text-align: right;
float: left;
height: 100%;
margin-top: 5px;
}
.cool-label input {
border: none;
background: transparent;
width: 175px; /* 250-70-5 padding */
padding: 5px;
padding-left: 70px;
margin-left: -60px;
}
.cool-label input:focus {
background: rgba(0,130,255,.1);
outline: none;
}You can use the labels themselves as the container for the inputs which leads to simpler markup by removing the divs. Not that it makes much difference in your example though.
Maybe if you are Amazon or Google, you can try to implement such a thing, if you have strong reasons to believe it will help users. But if you are not Amazon or Google, you should avoid surprising your users with some weirdness, and just stick to proven UX.
http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/...
I think the iPhone counts as "proven UX".
So it do not disappear when to give focus to the field.
I use Lastpass to manage my authentication information, and I always let it auto-fill new signup forms. It's an incredibly smart piece of software, and gets things right most of the time. However, on occasions when it doesn't fill up a everything correctly, not having a label is a big disadvantage. I have to first clear out the text, de-focus the form-field (Tab or Shift+Tab), then read the field name and come back and fill up that field.
* Use label tags in the initial render, JavaScript them into placeholders.
* Do not remove the placeholder until the user has both focused and started typing.
* Try and animate the placeholder to a safe location rather than removing it.
* Restore the placeholder if the user pauses after removing their input.
Personally, I favour example input in my inputs (as the author suggests) rather than embedded placeholders. Still, I can understand the assault on clutter from many designers, and I don't think the technique is so much bad as open to crappy implementations.I think that is the key point. A conventional label is simple and doesn't need all this extra support to be helpful to the user. I've never really liked the "label in the field" trend except in really simple forms where there's almost no chance for ambiguity anyway.
I never really thought why they were called 'placeholder' before but it makes sense; they are not labels, they are examples.
There is no try.
If you cannot move it to a reasonable location, do not use this method.
Also, on other note: username is Not an email address. Do not ask me for my username when you really mean email address.
Oh, and one more thing. Let me know (or make it easy to find out) what special rules you require for passwords on your login page. Your site is annoying because you probably require some special combinate of letters and numbers and possibly something else, which means I have to figure out which password pattern I should be trying.
Are you saying that sites should allow users to use email addresses to log in, rather than usernames? As I understand it, the former is a more recent thing.
I can't stand it when I try and log in to a website and fail 4 times. Then finally click "Forgot Username" and all that pops up is a box saying my username is my email address.
Everything else (like putting the labels to the left of the field or in the field) and you start seeing errors increase in form submissions. So it is to be avoided.
Part of that was simplifying the look of the checkout, which includes putting the labels inside of the inputs.
Not to mention some very notable websites use this design choice, including Square, Twitter, and Apple.
Because they seems to think that the placeholder as label works well [0].
Plus it will hurt your SEO. All the search engine sees is some form fields and little else.
* Don't make your label use the same style as user-entered text.
I remember encountering a website that failed to do this, while satisfying all the other points. It was super confusing to learn that the texts were just labels and not pre-filled values, since they had the exact same color as the text I entered (unlike HTML5 placeholders that are dimmed).And all this just to remove an important cue from the sight of your users?
Essentially they teach you to build web-sites for disabled users and at the same time for search engines. The gist is that search engines really ARE disabled themselves, they're somewhat blind and dumb.
So you really start to think about how information is presented on your site for more than just the fully-able users and when you look at "tricks" like putting labels within the placeholder element you immediately/instinctively know it is going to cause problems (for SEO and disabled users alike).
Worth checking out if you're interested in this topic and have a "lynda" account.
Personally i dont like using labels and instead use placeholders with tooltips in my forms. But now i might have to reconsider that approach.
http://en.wikipedia.org/wiki/National_Federation_of_the_Blin... http://en.wikipedia.org/wiki/Access_Now_v._Southwest_Airline... http://en.wikipedia.org/wiki/Ouellette_v._Viacom_Internation... http://www.dralegal.org/impact/cases/smith-et-al-v-hotelscom http://www.w3.org/WAI/EO/EO-Policy-USDOJ
The spec says:
The placeholder attribute should not be used as an alternative to a label. For a longer hint or other advisory text, the title attribute is more appropriate.
http://www.whatwg.org/specs/web-apps/current-work/multipage/...Have labels, but hide them with css.
Placeholder attribute in HTML5 handles this right - if you don't have anything in the field, it reverts to the placeholder text.
I might be an exception but can't recall a case when I would hover input field.
The design didn't allow for proper labels, being a standard first name and email address form in a small space, and the client wouldn't budge on it. Often we would see people putting their email address in the first input field. Eventually I used the email address verification Javascript from the second field on the first field. If an email address was found, it alerted to point that out and asked for first name in the first input while moving the email address to the second, correct input.
Ended up ripping all the placeholder stuff out.
A related problem: Chrome starts with "about:blank". When I start typing, it doesn't go away, so I have to manually select the text before.
A login form will be accompanied by a Login button, for example. In this case, the intention of the two preceeding input fields should be obvious. (A well-designed site would permit any unique user key, including email and username.) Placeholders, in this case, are generally acceptable.
At the other extreme, a customer information form would have to rely more heavily on explicit, rather than inferred/implicit cues. This includes labels, and their heavyweight siblings, descriptive tool-tips and sidebars. Very complex forms may require extensive documentation.
Most problems have a whole spectrum of possible solutions, supported by a wide variety of tools. Don't let a single aggressive voice narrow your understanding of that.
Sorry but no. In some cases, maybe in most cases, the right thing in not in the middle. For example: having or not ads on Wikipedia, using or not useless animations in websites, allowing or not third-party to access private data, etc.
So, removing a useful cue for user without strong reasons to do so is not "somewhat right", it is just wrong. It is a sin, and will send you to designers' hell (which is a room with thousands of 30' screens on the walls displaying random websites from 5 years ago).
I don't think so. I think he was trying to imply that there were objective reasons why labels are a good UI feature and that getting rid of them is unwise, even if it IS fashionable lately.
That is true of a lot of things in UI design. UI design is human enough that it IS affected by things such as fashions. But sometimes people forget that there are real, meaningful differences in usability, and often the "traditional" way of doing things is traditional for a good reason.
My own pet peeve in this regard? Menus. Microsoft office has made "ribbon" style interfaces quite popular instead of using menus. But menus had some important features: you could search through them exhaustively (at least the menus that aren't context-sensitive), and you can use the menus to incrementally learn the keyboard shortcuts for the features you use most often. Ribbons look nice, but they can't teach you to be faster.
Forgive me for this tangent, but please please please follow the above advice. I've had it with login and search forms that replace their submit button with javascript.
(Assuming in not worried about the issues in this article)
I use Jason Garber's jquery plugin to imitate placeholder for browsers which do not support the attribute.
Which brings me to my opinion: often it is better to just not mess with things like this. Keep it simple.
The local part of an email address is not an email address. If it asks for an email address during login, assume it means an email address.
edit: I'm not saying you should use placeholders as replacements for labels, this will probably invalidate your HTML.(guess). I'm saying this is not a very good point until it's proven to actually get in the way of the user experience. I don't think we should treat our users like idiots, because they're not, so any time that gets included in a design decision, (the assumption that our users are dumb), I already know it's a bad one.
Plus, if you have too many fields in your form, that you need to start adding labels for clarity, you should probably split that up and multi-page it.
I agree it would be nice to see an actual user study comparing task completion time. I'd imagine there's already something in SIGCHI on the efficacy of disappearing prompts.
http://en.wikipedia.org/wiki/Progressive_enhancement
@steveax, you're misunderstanding the concept. The idea is that users with screen readers will see labels, but those who don't can omit them. Progressive enhancement means building for screen readers first, for example, and progressively enhancing the experience for those who can support it.
You forgot to include this part, bro. "... while also providing an enhanced version of the page to those with more advanced browser software or greater bandwidth.""
If you're suggesting that a JavaScript technique could hide the labels for non-screen reader users, how exactly do you intend to determine that? (hint: it's not possible)
If that's true, then yeah, that's a terrible idea. You should never omit it from the DOM. I like to use icons to substitute for label text and just pack all the information I can into the legend. Text as a label is what I'm debating.
Accessibility first — it affects a lot more tan disabled users. Usability second. Pretty if you have time, and only insofar as it doesn't interfere with the first two.
It should be OK for a person to express an opinion or preference without being immediately dismissed as being useless because there's no data backing it up.
I didn't track and keep statistics on the matter, but I have encountered the very thing that author describes. Inputs that used placeholder tended to have more errors than ones that did not. Take the statement for what you want but in my experience I would avoid such things in my future projects.
Using placeholders as labels will not invalidate the HTML, it is a valid thing to do. This is not a debate over the validity of doing such a thing, but whether it's a good idea.
It's not saying that your users are idiots, but sometimes you do have to design/develop for the lowest denominator in the group. But then you always have a level of "can't make everyone happy".
Most cases of UX I've seen suggests that reducing the number of pages in submitting form data increases submission by reducing fatigue, confusion, and frustration. Think disappearing labels might be an issue for someone then find out what happens when the visitor can't remember something they filled in the page before; or worse, three pages ago. If there are too many fields on the page then you're better off trying to reduce the number of fields involved. Maybe get the bare minimum now and ask for more later after the form has been submitted.