Technorati tags:
code post |
snippet & script posting board
share your code and more
Join now!
1 Reader wrote a comment - add your comment.
Who links back? Links to this postTechnorati Tags: codepost, webdev


from CODE POST
TABINDEX, Focus onLoad and Lose the VALUE Text
Article by Joe Burns
This article is online:
http://www.htmlgoodies.com/tutorials/forms/article.php/11895_3479201_2
Lose the VALUE Text
You'll note up above that I have placed text inside the text boxes in the example form. I see this done a lot. You get that text by adding the attribute VALUE="some text" to the input tag.
Have you ever been to a form that had text in a box you were supposed to write in? The problem is that you click on the text box and the text remains. You need to highlight and erase all that text before you can put in your own text.
Well, erase no more. Click in the text box below...
<FORM> <INPUT TYPE="text" VALUE="This is text in a text box" SIZE="45" onFocus="this.value=''"> </FORM>
It's a little blip of JavaScript that does the trick. I have it in bold above. When focus is brought on the box (onFocus), the value of the box (this.value) is set to nothing. Note the empty quotes at the end of the code. Make a point of having the quotation marks right up next to one another like I do. If you have space between them, then that space will appear in the form element.
These great tricks will add usability to your pages.
- TABINDEX - The Command in Action
Get PLUMB - Blink - In My Arms ![]()
Listen to or visit PLUMB at MySpace.com/plumb
1 Reader wrote a comment - add your comment.
Who links back? Links to this post

www.flickr.com
|
Got Computer Woes?
We try to help...
Got Answers? We need You!!!

join Computer Woes !!!
@flickr groups
phone
or call: 217-697-4116
eVoice: 928-441-6801
eFax: 661-554-1509
web form
Please use this secure contact form to submit a comment, question, request, suggestion or link (email required).
LINKUP (link exchange)
To have your site link listed on this page you must link to this blog's main page or any post. Submit your site details (and terms, if any) via the contact form above, type LINKUP in the subject field. When received I will send linking instructions and then contact you when linked, usually within 24 hours.
Family Friendly links only!
The following types of content will not be accepted: adult, pornographic, obscene or profane content, or content intended to advocate or advance computer hacking or cracking, gambling, illegal activity, drug paraphernalia, hate, violence or racial or ethnic intolerance. I reserve the right to reject any site without specific cause.
JOIN
Share your code or script experience, articles, tools, software or suggestions on this posting board. Please follow the rules above for LINKUP. Use the contact form above to JOIN. Type Join in the subject field.
BENEFITS: Free promotion of your relevant product, blog, site and/or profile.
bulletBL.gifC:\Documents and Settings\{your computer username}\My Documents\My Pictures) where the image is saved for easy retrieval later.Type selector
h1 { text-transform: lowercase; }
Class selector
.myclass { text-decoration: blink; }
Id selector #myid
{ text-decoration: line-through; }
Dynamic pseudo-class selector
a:hover { text-decoration: blink; }
a:active { color: #660066; }
a:focus { outline: 2px dashed green; }
Typographic pseudo-element selector
p:first-line { font-weight: italic; }
p:first-letter { font-size: 3em; }
Content pseudo-element selector
p:before { content: "["; }
p:after { content: "]"; }
Child selector
#title > p { font-weight: italic; }
First-child pseudo-class selector
p:first-child { margin-top: 5; }
Adjacent sibling selector
h1 + p { font-style: bold; }
Attribute selector
option[selected] { color: #0000ff; }
input[type="password"] { color: #cc00cc; }
a[rel~="next"] { background: #ff0000; }
*[lang|="en"] { color: green; }