Debt Consolidation - Internet Advertising - Debt Consolidation - Wordpress Themes - Wordpress Themes

PDA

View Full Version : How do you print a Javascript string to a multiline text box?


Brandon Tanner
Jul 3rd 2008, 9:02 pm
Hey everyone,

I have a simple HTML multiline textbox, and I want to use Javascript to get text that the user types into that box, and then I want to print that text in a different multiline text box. How would I do that?

I've figured out how to get the value from the original textbox and write it on the screen, for example...

document.write("Here is your text... <BR>" +
window.document.formOne.userText.value);

...But I can't figure out how to print that value in *another* text box.

Any help is greatly appreciated. Thanks!

=Messa=
Jul 3rd 2008, 11:05 pm
Hello.

Here I created an example solution for you.


<html>
<body>
<form name="f">
<textarea name="ta1"></textarea>
<textarea name="ta2"></textarea>
<button type="button" onclick="javascript:document.f.ta2.value=document.f.ta1.value">Copy</button>
</form>
</body>
</html>

Brandon Tanner
Jul 4th 2008, 6:56 am
Thank you Messa! Works great :)