I am trying to code a webpage that does the following:

Listens for user key presses in an input box and dynamically writes them below the input box in a textarea.

Any help?

Recommended Answers

All 5 Replies

textarea IS an input
you could just type in the textarea

Thank you.
It it clear that I was fixated on the input and did not think of a text area as an input.

I found the following online.
It works in IE but not in FireFox.
Any suggestions on making it work in FireFox?

<script Language="Javascript">
<!--
function typewriter(typein) {
    var typeoutObj = document.getElementById('typeout');
    typeout.innerHTML = typein;
}
-->
</script>

Type In Here:

<textarea rows="3" name="typein" onkeyup="typewriter(this.value);"></textarea>
<br/><br/>
Type Out Here: <textarea id="typeout" readonly></textarea >

works for me in FF, i m using FF 3.5.2

it did give one warning, regarding the use of document.getElementById, so i changed the code to this and it still works but this time with no warning:

function typewriter(typein) {
document.getElementById('typeout').innerHTML = typein;
}

What error are u getting?
Have u tried firebug?

I was not getting an error.
I will check Firebug.
Thanks for the help

Sorry, i thought u had an error, the thread wasnt marked solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.