Text inside TEXTAREA

Discussion in 'JavaScript' started by inderpal, Aug 22, 2006.

  1. #1
    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
     
    inderpal, Aug 22, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    i believe you can modify it's attributes as a whole - but I don't think you can make a standard textarea colorized/stylized different for different portions of it.
     
    ccoonen, Aug 22, 2006 IP
  3. inderpal

    inderpal Active Member

    Messages:
    919
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    68
    #3
    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
     
    inderpal, Aug 23, 2006 IP
  4. mjamesb

    mjamesb Member

    Messages:
    88
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    48
    #4
    Yeah...a Div...just need to have the style of overflow on it.

    <div style="height:200;width:300;border:3px inset;overflow:scroll;">
    <div style="color:red;">I am red</div>
    <div style="color:green;">I am green</div>
    <div style="color:blue;">I am blue</div>
    <div style="color:red;">I am red</div>
    <div style="color:green;">I am green</div>
    <div style="color:blue;">I am blue</div>
    <div style="color:red;">I am red</div>
    <div style="color:green;">I am green</div>
    <div style="color:blue;">I am blue</div>
    <div style="color:red;">I am red</div>
    <div style="color:green;">I am green</div>
    <div style="color:blue;">I am blue</div>
    </div>
     
    mjamesb, Aug 26, 2006 IP
  5. ForumJoiner

    ForumJoiner Active Member

    Messages:
    762
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    83
    #5
    Is it possible to make AdSense code to display ads inside a textarea?
     
    ForumJoiner, Feb 6, 2007 IP
  6. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #6
    I've tried, but it does not work:

    
    <html>
    <head />
    <body>
    
    <textarea id="miarea" name="miarea" rows="7" cols="50" style="font-size:11px;">
    
    <script type="text/javascript"><!--
    google_ad_client = "pub-1234567890123456";
    google_alternate_color = "FFFFFF";
    google_ad_width = 300;
    google_ad_height = 250;
    google_ad_format = "300x250_as";
    google_ad_type = "text";
    google_color_border = "444444";
    google_color_bg = "777777";
    google_color_link = "0000CC";
    google_color_url = "008000";
    google_color_text = "000000";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
    </textarea>
    
    
    </body>
    </html>
    
    Code (markup):

    BTW, why you need ads inside a textarea ?
     
    ajsa52, Feb 7, 2007 IP
  7. ForumJoiner

    ForumJoiner Active Member

    Messages:
    762
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    83
    #7
    I like to run 2 kind of websites. One kind that wants to be helpful, like this
    wamp.lunlun.com, with little or no ads, and others where ads are placed everywhere.

    I'm curious, in the long run, which ones will be appreciated more. :)
     
    ForumJoiner, Feb 7, 2007 IP