SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text area containing html code

    Could someone explain how I can make a non-editable text area that contains html code. I just want the html code to be processed as normal text, not html. This text area is going to display code that my users can paste onto their own website. Would be much appreciated, thanks!

  2. #2
    [Biped] LJK's Avatar
    Join Date
    Jun 2004
    Location
    In My Jammies
    Posts
    761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi -
    Why does it have to be a textarea?
    Code:
    <form method="post" action="#">
    <textarea readonly="readonly" cols="40">
    <span>This is a span.</span>
    
    <h1>This is a header.</h1>
    </textarea>
    </form>
    Hope that helps,
    El
    F-Fox 2.0 :: WIN :: el design :: US

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't have to be a text area... what would my other options be?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Non-editable: use the readonly attribute.

    Display HTML markup: escape all '<' characters as &#38;lt; and preferably also all '>' characters as &#38;gt;.
    Birnam wood is come to Dunsinane

  5. #5
    [Biped] LJK's Avatar
    Join Date
    Jun 2004
    Location
    In My Jammies
    Posts
    761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi -
    You could create a .txt file w/ all the code,
    then just link to it ;-)
    F-Fox 2.0 :: WIN :: el design :: US

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LJK
    Hi -
    You could create a .txt file w/ all the code,
    then just link to it ;-)
    The code includes the username and other qualities of the logged in user who is viewing it.

  7. #7
    [Biped] LJK's Avatar
    Join Date
    Jun 2004
    Location
    In My Jammies
    Posts
    761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fair enough ;-)
    F-Fox 2.0 :: WIN :: el design :: US


Bookmarks

Posting Permissions

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