aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to copy a textbox answer to a textarea using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to copy a textbox answer to a textarea using javascript" Watch "how to copy a textbox answer to a textarea using javascript" New topic
Author

how to copy a textbox answer to a textarea using javascript

Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
Hi all,

I'm facing a problem here. I want to copy the answer in a textbox to a textarea using a javascript function.


- Christian
Shyam kumar
Ranch Hand

Joined: May 21, 2006
Posts: 146
Hi,

You can do this by first obtaining the id's of the textbox and textarea tags and then assigning the value attribute of the textarea to the text box. Please see the script below:

--------------------------------------------

function transfer(){
document.getElementById("text1").value=document.getElementById("textarea1").value

}
<input type="text" id="text1" name="textbox" value="Textbox"/><p>
<textarea id="textarea1">TextArea here!!! </textarea>
<button onclck="transfer()">Submit</button>


-----------------------------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to copy a textbox answer to a textarea using javascript