In-Field Labels: A Better Way + jQuery Plugin
fuelyourcoding.com
fuelyourcoding.com
You still have a point about the usability of labels outside the form field, especially given the caveat in the article that "this plugin still has problems when the browser tries to pre-fill the fields".
But it's still a useful technique because it makes the labels a lot easier to read because it's possible to left-align both the labels and the input fields. Just to give you a sense on how much thought needs to go into the graphic design of labels and form fields, here's a breakdown of the pros and cons behind labels arranged vertically, left-justified and right-justified:
http://www.lukew.com/resources/articles/web_forms.html
There's so much to learn about form design that the guy milked into an entire book.
It is pretty, though.
For six form fields, it took 500ms (according to firebug's profiler) to initialize on a 2.4ghz core 2 duo. Granted, I'm using Firefox 3, and not 3.5.
I'm assuming that this scales linearly with each form element that this trick is applied to, in which case a page with 12 form elements would take 1 full second to initialize the javascript.
I'd stay away from this if you have more than two form elements using it. It's bound to slow down the user experience unbearably.
On the examples page, I profiled the five InFieldLabel calls at a total of just over 28ms. Firefox 3.5, 2.2 Ghz Core Duo. Its not the field calls that take 500ms, even in Firefox 3.0.
What I profiled as taking that long was the jQuery init functions, which I assumed were required (and called by) the plugin.
Then again, I'm not as familiar with jQuery as I once was. All I know is that I don't like method chaining (impossible to set mid-line breakpoints and try/catch blocks), the extended element (if it's anything like prototype) is extremely heavy and not needed a majority of the time, and if you use massive amounts of it (see: slashdot) the user experience is deleteriously affected.
And really, 500ms initialization (even if it's jQuery and not the plugin initializing, that's a long time) for a user-experience-worsening toy like this.. I don't see the point.
The main pain point of that is that you can't see what field means what once you've got content in it.
Oh and its dreadful if you disable Javascript.
As far as Javascript is concerned, I am going to add that into the plugin. Basically, add a class that moves the label over the field when the script is run. Good point though.
I voted the effort and the plugin.
The link above posted by alabut is awesome, thanks.
Giving some people jQuery is like giving a monkey a gun.