Reply to Re: A little java help??

Your name:

Reply:


Posted by Jukka K. Korpela on 12/16/06 16:52

Scripsit nice.guy.nige:

> While the city slept, Olli Mäntyranta (ollimax@gmail.com) feverishly
> typed...
>
>> sally jo wrote:
>>> What is the code that you use to put words int he input box that
>>> disappear when the user starts typing??
> [...]
>> function ClearText(){
>> document.theBigForm.theField.value = "";
>> }
> [...]
>
> The only problem with this code is that it will clear the textbox
> everytime it is clicked on.

No, the problem is that it sometimes "works". Therefore it lets the author
preserve the impression of being clever and doing the right thing. Well, it
also wipes our user input, of course, at times.

> if(firstTime) {
> document.theBigForm.theField.value = "";
> firstTime = false;
> }

It does not help against the problem that the user starts typing and then
the JavaScript code starts executing and kills his input. Of course, if the
author is slow in typing, he never realizes this.

So the clue is that the original idea, which creates the problem, should be
abandoned. Do _not_ put any initial content in a textfield, unless it is a
meaningful default, and then you surely don't want to remove it when the
user focuses on the field.

Instead, use meaningful labels and, if needed, explanations - before the
textfield.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация