?
Solved

Change textarea onclick (with html)

Posted on 2006-06-29
4
Medium Priority
?
1,542 Views
Last Modified: 2012-08-14
Hi,

I have a menu on the left of my page and when a button is clicked, i want the textarea in the middle of the page to change.  I figured out how to do that, but only in plain text.  When i change the value to hey<br>hi, it shows that exactly, but i want it to show:

hey
hi

is there a way to do this with a textarea?  Or is there another way to do this that is easier?  Thanks!
-Kyle
0
Comment
Question by:kylen1010
[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
  • 2
4 Comments
 
LVL 2

Author Comment

by:kylen1010
ID: 17012489
I know it's spaced really weird, but here is the code.  Thanks!


<html>
<head>
<LINK REL=STYLESHEET TYPE="text/css"
HREF="style.css">
</head>
<body>
<form name="form" id="form">
<input type=hidden id="homehidden" value="
HOME<br>hey2
"><input type=hidden id="abouthidden" value="
about
"><input type=hidden id="10hidden" value="
10 goals
"><input type=hidden id="rockshidden" value="
rocks
"><input type=hidden id="topicshidden" value="
topics
"><input type=hidden id="meetingshidden" value="
meetings
">
<table width=100% border=1 class="h3">
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('homehidden').value" style="cursor:pointer;cursor:hand"><img src="home.gif" height=70></a></td><td rowspan=6><textarea cols=100 rows=20 readonly id="bodyfdsfadsf" class="textarea">hey<br>hi</textarea></td></tr>
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('abouthidden').value" style="cursor:pointer;cursor:hand"><img src="about.gif" height=70></a></td></tr>
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('10hidden').value" style="cursor:pointer;cursor:hand"><img src="10.gif" height=70></a></td></tr>
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('rockshidden').value" style="cursor:pointer;cursor:hand"><img src="rocks.gif" height=70></a></td></tr>
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('topicshidden').value" style="cursor:pointer;cursor:hand"><img src="topics.gif" height=70></a></td></tr>
<tr><td><a onclick="document.getElementById('body').value = document.getElementById('meetingshidden').value" style="cursor:pointer;cursor:hand"><img src="meetings.gif" height=70></a></td></tr>

</body>
</html>
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 540 total points
ID: 17012667
textarea, as its names indicates, displays text, not html.

if you want a line break between "HOME" and "hey2", use this:

<input type=hidden id="homehidden" value="
HOME
hey2
">

if you want to display HTML, then use an iframe.

note that you should rename id="bodyfdsfadsf" into id="body"
... and maybe use some othe id than "body", it's confusing.
0
 
LVL 2

Author Comment

by:kylen1010
ID: 17013401
Thank you GrandSchtroumph!  I decided to just use iframes.  Thanks!
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17013695
:)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

801 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