You are here: Re: Why does this not fully work? <Textarea> + DIV + InnerHTML « HTML « IT news, forums, messages
Re: Why does this not fully work? <Textarea> + DIV + InnerHTML

Posted by Good Man on 10/26/07 14:27

SaraLeePerson@gmail.com wrote in news:1193408017.649249.158790
@y42g2000hsy.googlegroups.com:

> <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? :-)


why use "onkeydown()"? your function is working (aside from your terrible
HTML that is missing quotes at random).

when the key is going down, there *is* no value in the textarea yet. use
onchange(); or something.

 

Navigation:

[Reply to this 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

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