Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Outputting html code to a <textarea> tag

Posted on 2003-02-19
4
Medium Priority
?
186 Views
Last Modified: 2010-04-09
I was thinking of using a <textarea> tag to do this:

e.g.

<textarea><b>example sentence blah blah blah</b><br><hr></textarea>

But i found doing this doesn't translate any of the html tags in between the <textarea></textarea>, and just treats them as normal text.  Is there anyway of getting round this or has anyone got any alternate ideas?

Basically it's for an online diary replies section, where replies are read from the database and fed into this textarea.
0
Comment
Question by:bizla
4 Comments
 
LVL 3

Expert Comment

by:AmericanDogma
ID: 7983949
Try using

<textarea><pre>      - Values Here -      </pre></textarea>

values Here would be where all the html you wnat to display in the textbox goes
0
 
LVL 17

Accepted Solution

by:
dorward earned 200 total points
ID: 7984549
Textareas are designed to allow users to input data.

It sounds more like you are trying to use it as a scrollable display area.

Try something like:

<div style="width: 25em; height: 5em; border: black 0.5ex inset; overflow: auto">

Your content

</div>
0
 
LVL 30

Expert Comment

by:third
ID: 7984657
0
 

Author Comment

by:bizla
ID: 7990589
Cheers Dorward...works like a charm!

-BIZ-
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

571 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