[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Change textarea onclick (with html)

Posted on 2006-06-29
4
Medium Priority
?
1,549 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

650 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