|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Having multiple styles for one textarea
anyone know if theres a way to change the font color inside of a textarea for one word. Example: in this textarea (the one im typing in right now) the font is always black, does anyone know how to like make it so u can have multiple colors instead of just one? Im sure there's probably some kinda super sweet javascript solution to this... any ideas?
|
|
#2
|
|||
|
|||
|
RE: Having multiple styles for one textarea
for that you'd do something like this:
b.weird { font-family: helvetica; font-weight: normal; font-size: 13; color: #FF0000; text-decoration: none; } then in your textarea you'd type: this is my <b class="weird">different</b> color |
|
#3
|
|||
|
|||
|
RE: Having multiple styles for one textarea
HTML works inside of textareas? leme see..
|
|
#4
|
|||
|
|||
|
RE: Having multiple styles for one textarea
nope, it prints everything inside of the <textarea></textarea> tags. i know there must be some way to do this...
|
|
#5
|
|||
|
|||
|
RE: Having multiple styles for one textarea
I do not believe this is possible... You can change the font color for all text, but I have never seen it done on a word by word basis. If someone does know a way to do it, let us know, I could use something like that myself.
|
|
#6
|
|||
|
|||
|
RE: Having multiple styles for one textarea
oh sorry, i have a problem reading things through completely sometimes and misunderstood O_O ..i don't know how you can do what you're asking, unless you're using one of those progz. i found something that might be useful?
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE></TITLE> <SCRIPT LANGUAGE=javascript> <!-- function setStyle(){ var objForm = document.forms[0] if(objForm.elements['field1'].checked){ objForm.elements['textarea1'].style.color = "red"; }else{ objForm.elements['textarea1'].style.color = "black"; } } function setDisabled(objControl){ var objForm = document.forms[0] if(objForm.elements['field1'].checked){ objForm.elements['field1'].focus(); } } //--> </SCRIPT> </HEAD> <BODY> <FORM action="" method=post id=form1 name=form1> <TEXTAREA rows=10 cols=10 name="textarea1" id=textarea1 style="" onFocus = setDisabled(this)>This is the sample text.</TEXTAREA> <INPUT TYPE=checkbox name=field1 onClick = setStyle()> Disable textarea. </FORM> </BODY> </HTML> |
|
#7
|
|||
|
|||
|
RE: Having multiple styles for one textarea
Im going to atempt to do somthing like this in JS.. if it works, i'll post up the code. Thanks.
|
|
#8
|
|||
|
|||
|
RE: Having multiple styles for one textarea
Wow didn't see ur post comming... Im looking at thoes progz. you hit the spot my friend... thank you!
|
|
#9
|
|||
|
|||
|
RE: Having multiple styles for one textarea
what you are looking is html editor in web browser. IE has had this feature from ie5.5, and mozilla now has it from moz1.3
there are couple of commercial solutions built around this so called content-editable regions in html, but if you want an opensource one, look at htmlarea http://www.interactivetools.com/staff/ben/htmlarea3_demo/example.html new version 3 of htmlarea also supports mozilla, but is still in beta (or even alpha..) to look for more scripts like this, search google for "content editable" and "html edit(or)"... |
|
#10
|
|||
|
|||
|
RE: Having multiple styles for one textarea
yeah that's the exact one i gave him zombie
|
|
#11
|
|||
|
|||
|
RE: Having multiple styles for one textarea
:uhoh:
uhoh... well, you will forgive me, wont you? it is still my b-day ;) |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Having multiple styles for one textarea |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|