Pages

Thursday, November 13, 2008

Tutorial: FORM TRICKS

TABINDEX, Focus onLoad and Lose the VALUE Text
Article by Joe Burns
Copyright Internet.com All rights reserved.

This article is online:
http://www.htmlgoodies.com/tutorials/forms/article.php/11895_3479201_2


Lose the VALUE Text
Note the text inside the text boxes in the example form; added the attribute VALUE="some text" to the input tag.


Click inside the box:

The "default text" is removed when box is selected/clicked.

Here's the code:


<FORM> <INPUT TYPE="text" VALUE="Default Text" SIZE="45" onFocus="this.value=''"> </FORM>

It's JavaScript, when focus is given to the box (onFocus), the value of the box (this.value) is set to nothing. Note the empty quotes at the end of the code; the quotation marks must be used without a space; any space added between quotes, will appear in the form element.

View more tricks ...
TABINDEX - The Command in Action
Focus onLoad
Lose the VALUE Text


Get PLUMB - Blink - In My Arms Plumb - Blink - In My Arms
  Listen to or visit PLUMB at MySpace.com/plumb







<< code post Subscribe to RSS Feed

2 comments:

Web Design Quote said...

Nice tutorial. I hope you will be adding some more post like this one. This post is relatively new for me and i get some useful information from this post.

Web Design Fort Worth said...

Really this post is pretty good.

^Top

Some work on this page is licensed under a
Creative Commons License
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.


 ||