Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change/access  text in TEXTAREA         HTML/Javascript

Posted on 2006-11-01
3
Medium Priority
?
5,536 Views
Last Modified: 2011-08-18
HOw can I modify text in text Area.  assuming there is already some text in text aria
0
Comment
Question by:mostenscer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 17848648
<!-- Change text area
      2006-11-01 rs
-->
<form>
<textarea name=text1 style="width: 500px; height: 300px">
</textarea><br>
<input name=in1 value="Some text">
<input type=button value="Click to change text area" onclick="this.form.text1.value=this.form.in1.value"><br>
<input name=in2 value="Add text">
<input type=button value="Click to add to text area" onclick="this.form.text1.value=this.form.text1.value+'\n'+this.form.in2.value">
</form>

Instant Demo: http://www.sendspace.com/file/itvixp changeTextarea.htm
0
 
LVL 1

Expert Comment

by:puneetmahajan1982
ID: 17848781
Run this code :


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>
<form ID="Form1">
<textarea style="width: 500px; height: 300px" ID="Textarea1">
Hello
</textarea><br>

<input value="Some text" ID="Text1">
<input type=button value="Click to change text area" onclick='document.getElementById("Textarea1").value = document.getElementById("Text1").value' ID="Button1" NAME="Button1"><br>
<input value="Add text" ID="Text2">
<input type=button value="Click to add to text area" onclick='document.getElementById("Textarea1").value =document.getElementById("Textarea1").value +"\n"+ document.getElementById("Text2").value' ID="Button2" NAME="Button2">
</form>

</body>
</html>
0
 
LVL 30

Accepted Solution

by:
callrs earned 1500 total points
ID: 17848801
Oops, I posted wrong link. Here's the demo: http://www.sendspace.com/file/dn3og0 changeTextarea.htm

(There's also a "Split points" link below)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question