Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 29th, 2003, 04:19 PM
protonagenet protonagenet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Virginia
Posts: 50 protonagenet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to protonagenet
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?

Reply With Quote
  #2  
Old July 29th, 2003, 04:29 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
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

Reply With Quote
  #3  
Old July 29th, 2003, 04:47 PM
protonagenet protonagenet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Virginia
Posts: 50 protonagenet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to protonagenet
RE: Having multiple styles for one textarea

HTML works inside of textareas? leme see..

Reply With Quote
  #4  
Old July 29th, 2003, 04:50 PM
protonagenet protonagenet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Virginia
Posts: 50 protonagenet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to protonagenet
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...

Reply With Quote
  #5  
Old July 29th, 2003, 05:02 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
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.

Reply With Quote
  #6  
Old July 29th, 2003, 05:04 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
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>

Reply With Quote
  #7  
Old July 29th, 2003, 05:05 PM
protonagenet protonagenet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Virginia
Posts: 50 protonagenet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to protonagenet
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.

Reply With Quote
  #8  
Old July 29th, 2003, 05:08 PM
protonagenet protonagenet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Virginia
Posts: 50 protonagenet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to protonagenet
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!

Reply With Quote
  #9  
Old July 29th, 2003, 10:19 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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)"...

Reply With Quote
  #10  
Old July 29th, 2003, 10:25 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Having multiple styles for one textarea

yeah that's the exact one i gave him zombie

Reply With Quote
  #11  
Old July 29th, 2003, 11:31 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Having multiple styles for one textarea

:uhoh:

uhoh...

well, you will forgive me, wont you? it is still my b-day ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Having multiple styles for one textarea


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway