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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML effects inside <textarea>

    Can I get a few html tag effects inside a textarea?

    The following code doesn't work correctly,
    but it will tell what I am trying to do.
    Code:
    <form action="action.cfm">			
       	
         <textarea name="message" rows="10">
    
             <font color=red>This is red</font>
             <font color=blue>This is blue</font>
             <font color=green>This is green</font> 
    
         </textarea>
    
        <input type="submit">
    
    </form>
    Thanks in Advance
    Last edited by joonstar; 09-26-2004 at 05:43 PM.
    Get my greedy up

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Might be able to do it with javascript or something, but the textarea's are text-only. HTML won't do anything in there, it'll just render as text

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Location
    engoku no anime
    Posts
    354
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <form action="action.cfm">			
      <button onclick="document.getElementById('message').style.color='red';">Red</button>&nbsp;  <button onclick="document.getElementById('message').style.color='blue';">Blue</button>&nbsp;  <button onclick="document.getElementById('message').style.color='green';">Green</button><br>
         <textarea name="message" rows="10" id="message" style="color: red;">
            This should be red until one of the buttons above is pressed.
         </textarea>
    
        <input type="submit">
    
    </form>
    That should work, but I'm no JavaScript expert. Unfortunately, I can't think of a way to get colors in the way you wanted. The text has to be all one color. Sorry. Perhaps the JS forum has some better answers.

  • #4
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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