Intrinsic Form Values
Rather than type a long explanation of what exactly this is and what it does, it's best to just show you:
If you still don't understand what this does, here's a short explanation: Onfocus of form field, default value is automatically cleared and, if no value is entered, return the default value (onblur).Why use this? Personally, I feels it's a waste of space to label form fields (perfect example on the NY Times Login Page) ...it also looks pretty cluttered.Enough jibjab, here's how I do it (there are other ways, of course...but this one seems to work easiest and the best):
<input class="input" name="fieldname" value="Click in me then click away" onfocus="if(this.value == 'Click in me then click away') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Click in me then click away';}">
1 Comment »
RSS feed for comments on this post. TrackBack URL
[...] Intrinsic Form Values (tags: php programming resources design code blogs blogging blog articles development free geek generator hacks ideas wordpress webdesign webdev wevdev web tutorials tutorial tools tips javascript web2.0) [...]