Reply to Re: Why does this not fully work? <Textarea> + DIV + InnerHTML

Your name:

Reply:


Posted by Harlan Messinger on 10/26/07 15:17

SaraLeePerson@gmail.com wrote:
> <form name=theform>
> <textarea onkeydown="whynowork()" ID="inputbox" cols=25 rows=5></
> textarea>
> </form>
>
> <div id=divtag></div>
>
> <script>
> function whynowork(){
> document.getElementById("divtag").innerHTML =
> document.forms['theform'].elements['inputbox'].value
> }
> </script>
>
> Hello
> Can someone please explain what I am doing wrong here? When you enter
> something into the textarea, it skips the first character. How can I
> rectify this problem? :-)

Because there isn't a character until the key has come back up and the
key press has been registered. If you type more than one character, the
display in the divtag div should be one character behind each time. Use
onkeypress.

[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

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