Solved

Change textarea onclick (with html)

Posted on 2006-06-29
4
1,538 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
  • 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 135 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
CSS Style on Chrome 1 40
What cart is this? 2 38
html5 1 17
Diff of the day 2 9
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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. …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

726 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