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,037
    Thanks
    0
    Thanked 250 Times in 246 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>


  •  

    Posting Permissions

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