SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you print a Javascript string to a multiline text box?

    Hey everyone,

    I'm new to JS so forgive me if I sound like I don't have a clue what I'm talking about here ( - :

    Let's say I have a simple HTML multiline textbox. 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!

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    document.getElementById("other").value = someText;
    Here, other is the ID of the second textarea and someText is the text you want to assign to it.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Code:
    document.getElementById("other").value = someText;
    Here, other is the ID of the second textarea and someText is the text you want to assign to it.
    Thanks for the help, Tommy!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •