SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast inderpal.singh's Avatar
    Join Date
    Jul 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text inside TEXTAREA

    Hi,

    Is it possible to put text inside TEXTAREA in different colors? Say first line in red, second line in blue. I have to do something like that but am not sure how to do it. Any pointers/directions will be highly appreciated.

    Thanks in advance!!

    Best Regards,
    Inderpal Singh

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No. The content type of TEXTAREA is #PCDATA, i.e., plain text where character entities are parsed. It cannot contain markup, which would be needed for colour-coding.

    You'll need some sort of rich text editor for this.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast inderpal.singh's Avatar
    Join Date
    Jul 2006
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I know it's not possible to put different color text inside TEXTAREA field. but, is there any component (works in both IE and Firefox) which I can use in HTML where I can put different color text and should be scrollable?

    Best Regards,
    Inderpal Singh

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might be interesting for you

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it only has to be scrollable, then you can use, e.g., a DIV with a specified width and height plus overflow:scroll (or overflow:auto).

    If you need it to be editable, you're going to need something more complicated, though.
    Birnam wood is come to Dunsinane


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
  •