...

View Full Version : Specific Colored Text in a TextArea....



isaaclloyd
07-13-2005, 10:59 PM
I am trying to make a text area where anything that begins with "<" until it reaches a ">" is colored green. As you can guess I am using a textarea to edit text files on a website and want the SCRIPT part to be green and the normal stuff black. I think there should be a way to read through the textarea and color parts of the text. I've seen it in HtmlArea text editors but havn't been able to figure out how they do it. Any comments or suggestions would greatly be appreciated. Thanks for your time.


~Isaac~

sparks80
07-14-2005, 12:07 AM
The HTML textarea does not support multiple colours, so you cannot do this using conventional HTML and javascript I believe. You could try searching on the internet for a java applet that has support for this, for example the java class JTextPane allows multiple colours.

The only properties of the textarea you can change using standard HTML are the background and foreground colours which can be set using CSS.

.exampleclassname {
background-color:#FF0000;
color:#FFFFFF;
}

isaaclloyd
07-14-2005, 12:10 AM
Ok, Thanks...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum