Probably not possible but .... Textarea multiple font colors
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Probably not possible but .... Textarea multiple font colors
Hi,
Would anybody know if it's possible to highlight words within a textarea on a web page? Not sure you can specify font colors for just certain words... just the whole font in the textarea I belive?
Thanks
Would anybody know if it's possible to highlight words within a textarea on a web page? Not sure you can specify font colors for just certain words... just the whole font in the textarea I belive?
Thanks
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
HTMLArea is another rich text editor you can use as a replacement for a text area.
http://www.kevinroth.com/rte/demo.htm is another
http://www.kevinroth.com/rte/demo.htm is another
Last edited by CoderGoblin on Wed Feb 09, 2005 8:26 am, edited 1 time in total.
I have just integrated this one into a CMS i am developing....it is very good with a small file size.CoderGoblin wrote:http://www.kevinroth.com/rte/demo.htm is another
Thanks for the heads up
Mark
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Thanks for that.... the hoteditor one that feyd posted has the JS protected and it all need unescaping to read it... this is nicer cheers. It's not your coding is it?
I might change it to remove the buttons etc and just automate syntax highlighting like Dreamweaver or the brilliant freeware Crimson Editor would do.
Good stuff
I might change it to remove the buttons etc and just automate syntax highlighting like Dreamweaver or the brilliant freeware Crimson Editor would do.
Good stuff
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
If you are talking about the kevinroth demo it is not my code (although it initially took me a long time to find itd11wtq wrote:It's not your coding is it?
I might change it to remove the buttons etc and just automate syntax highlighting like Dreamweaver or the brilliant freeware Crimson Editor would do.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Yeah I just took out all the chunk of code with the buttons in.... I don't want any options for the user to change font colors themselves etc.... i want the colors to just change if the string matches a function from an array of functions and so on and so forth.... I'm at work at the moment but I'll have a good play with it later.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Yeah thanks I had done it already... I just need to see what the other functions do so I can remove the stuff I don't need... all I need are the one's to set font colors and create bold text... haven't even looked how it's done yet, I need time to sit and look at it properly.
The basic idea is to have several plain text files, one for functions, one for PHP syntax and anything else I need. Then These are used to build some arrays... onKeyup or whever the text box is checked for any words that match the value of a function or whatever and if so, the string is colored automatically. Sounds simple but I'm sure i'll trip up. I'll also need to validate whether or not a string has been unquoted etc and brackets are closed or open. The last thing I'll be doing is automatically creating tabs for nested blocks of code... I'll put the code up in snippets when it's done
The basic idea is to have several plain text files, one for functions, one for PHP syntax and anything else I need. Then These are used to build some arrays... onKeyup or whever the text box is checked for any words that match the value of a function or whatever and if so, the string is colored automatically. Sounds simple but I'm sure i'll trip up. I'll also need to validate whether or not a string has been unquoted etc and brackets are closed or open. The last thing I'll be doing is automatically creating tabs for nested blocks of code... I'll put the code up in snippets when it's done
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany