Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    displaying raw html in a standard text area

    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?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Try this:

    CSS:
    Code:
    #html_output {
      width: 260px; 
      height:450px; 
      overflow:scroll; 
      border:1px inset silver;
    }
    HTML:
    Code:
    <pre id="html_output">{html_output_from_db}</pre>
    If you want it to be editable...
    Code:
    <pre id="html_output" contentEditable="true">{html_output_from_db}</pre>
    Last edited by glenngv; 07-18-2007 at 02:35 AM.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    LinkBacks (?)

    1. 09-03-2014, 05:46 AM

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •