HighDots Forums  

Need help with changing text color in combo box?

alt.html.writers alt.html.writers


Discuss Need help with changing text color in combo box? in the alt.html.writers forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
2ontheway
 
Posts: n/a

Default Need help with changing text color in combo box? - 07-25-2006 , 10:59 AM






Hello,
I am new at this and have a question. I have created a combobox and
have written a bit of javascript so that based on my selection the
value of that option will be displayed in a text area. Now, my
question is, i need to have it displayed with some of the words in the
value a different color at the very least bold. for instance, in my
code below, you will see the value for the options. in those option
values I want, for instance, car and garage to be a different color or
bold, but the rest to be default. Can anyone help me?
If it isn't possible, can anyone suggest something that will work that
basically lets the user choose an option and it return a block of text
and within that text SOME of the words are a different font?
Thanks


<SCRIPT language="JavaScript" type="text/javascript">
<!--
function OnUpdateValue(ComboList)
{
var strValue = ComboList.options[ComboList.selectedIndex].value;

if (strValue)
{
TextArea1.value = strValue;
}
}
//-->
</SCRIPT><select name="Combobox1" size="1"
style="width:232px;height:21px;font-family:Arial;font-size:12px;"
onchange="OnUpdateValue(this)";>
<option selected></option>
<option value="the car is in the garage"
<option value="The fox is in the house"
<option value="L2B">Background - Column 2</option>
<option value="TBD">Background - Column 3</option>
</select>


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.