Results 1 to 8 of 8

Thread: Displaying HTML inside of a <textarea>

  1. #1
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default Displaying HTML inside of a <textarea>

    Can any of the HTML guru's on here help me with this... I want to display HTML inside of a <textarea>.

    Here is the code I'm using:

    HTML Code:
    <textarea name="AUP" cols="70" rows="8">
    A bunch of text here with html code inside of it
    </textarea>
    Its not an input form or anything like that... I just want the text to be displayed in a box with a scroll bar on the right side. I need to be able to have the text formatted though in HTML

    Thanks in advance for any help
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    You can't display HTML in a textarea, which is why it's called a textarea. However there are some funky things you can do with CSS to a textaea which act like HTML inside a textarea.

    <style type="text/css">
    <!--
    .cssnamehere {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: bold;
    color: #000066;
    text-decoration: none;
    background-color: #CCFFFF;
    }
    -->
    </style>

    <textarea name="name" cols="2" rows="5" class="cssnamehere">Text in the field</textarea>

    If you want the text to be displayed in a "box" with a scrollbar then why not use an iframe? It's a lot easier to deal with and will do exactly what you want.

  3. #3
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Quote Originally Posted by Bruceper View Post
    If you want the text to be displayed in a "box" with a scrollbar then why not use an iframe? It's a lot easier to deal with and will do exactly what you want.
    Are iframe's friendly to MAC users?
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Is anyone friendly to a mac user?

    http://www.topxml.com/xhtml/xhtml_tag_iframe.asp iframes are in the xhtml specifications so it should be "friendly" for anyone who uses a current browser.
    Last edited by Bruceper; 02-12-2008 at 03:39 PM. Reason: typo fixed

  5. #5
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Quote Originally Posted by Bruceper View Post
    Is anyone friendly to a mac user?


    Thanks for the help Bruce!
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  6. #6
    Join Date
    Dec 2007
    Posts
    70

    Default

    Quote Originally Posted by FSGDAG View Post
    Are iframe's friendly to MAC users?
    I have a few "Joomla" sites, and use one or two "Wrappers" which uses Iframes to wrap a site into the parent Template..

    Tested with IE 7.. works fine
    Tested with Mac.. works fine
    Tested with FireFox.. Not good.. for some reason FireFox does not load the Background, so using a dark Joomla, and Wrapping a Light website does not look good (or vice versa )

    I find it so irritating that the browsers vary so much!!.. sometimes it is minor, but other times it a very big difference. And I don't know enough to fix the problem..

    de P

  7. #7
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    jsut use a scrollable div tag like i did on my site here :

    http://www.theleisureguide.co.uk/england/bedfordshire/

    <div style="overflow:auto; height:100px"> text here </div>

    just change the height to whatever, also works with width (but then you get annoying side scrollbars, so i dont bother with that)
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  8. #8
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Thanks Inspireme! That looks like a good solution as well
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

Similar Threads

  1. Moving category image from index.html to browse.html
    By twomiracles in forum Blocks and Modification
    Replies: 4
    Last Post: 02-11-2008, 08:42 AM
  2. Delete a category with the links inside
    By Mickey in forum Blocks and Modification
    Replies: 0
    Last Post: 02-19-2007, 02:28 PM
  3. Replies: 1
    Last Post: 02-04-2006, 08:56 PM
  4. Replies: 1
    Last Post: 06-03-2004, 08:03 AM
  5. Replies: 2
    Last Post: 02-18-2004, 11:32 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
  •