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.
[Back to original message]
|