...

View Full Version : displaying raw html in a standard text area



rock_14
07-17-2007, 07:19 PM
I have html content stored in a db. I am using smarty templating engine to output the content to a text area.

<TEXTAREA NAME="few" COLS=30 ROWS=30>{html_output_from_db}</TEXTAREA>

What I get is raw html as it is stored in the db. How can I get a text area to instead display the actual markup (e.g., where instead of seeing bold tag <b>word</b> a person sees word in bold in the text area.

Any ideas?

glenngv
07-18-2007, 02:32 AM
Try this:

CSS:

#html_output {
width: 260px;
height:450px;
overflow:scroll;
border:1px inset silver;
}
HTML:

<pre id="html_output">{html_output_from_db}</pre>
If you want it to be editable...

<pre id="html_output" contentEditable="true">{html_output_from_db}</pre>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum