The text inside of an <option> tag is 'pure-text', in other words, what 
you type there will be what you get.
2 things..
1.  To escape the # sign so that you can use it in your HTML, just 
type it twice.  ##  Coldfusion will see this and replace it with 1 # 
for the html to see.
2.  Use styles.  eg. <option style="color:##990000;"></option>  This 
should control the color of the text between the option tags.

Personally, I would not use a closely defined color.  I would use 
<option class="classclosed"></option>
and then define classclosed in the stylesheet as
..classclosed {color:#990000}

This will allow me to reuse the code for the drop down on several 
pages and only update the look and feel in 1 place.  For example.  If 
my client decides they want it to be 50% gray and italics, my change 
would be:
..classclosed {color:#666666;font-style:italic;}
Thus causing a site-wide change to the user interface with 1 code 
change instead of a 'search/replace' sitewide.


Hope this helps,
William

-----Original Message----

-I have a drop down menu being created from a query:
-
-   <cfselect name="class" size="1">
-      <option value="" selected="selected"></option>
-      <cfoutput query="qGetClasses">
-         <option value="#qGetClasses.primaryKey#">#qGetClasses.
sectionTitle#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(qGetClasses.
startingDate, "mm/dd/yyyy")# - #DateFormat(qGetClasses.endingDate, 
"mm/dd/yyyy")#</option>
-      </cfoutput>
-   </cfselect> 
-
-What I would like to do is be able to change to color of the text 
based on specific criteria, as in if the class is no accepting 
students.  I would do this through an CFIF clause (not created yet).  I 
want to prove that the formatting can be accomplished before I go to 
the next step of creating the CFIF clause.
-
-Problem.  I was hoping it could be as simple as adding tags around 
the option seen below:
-
-<option value="#qGetClasses.primaryKey#"><font color="#FF0000"
>#qGetClasses.sectionTitle#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat
(qGetClasses.startingDate, "mm/dd/yyyy")# - #DateFormat(qGetClasses.
endingDate, "mm/dd/yyyy")#</font></option>
-
-However, coldfusion complains because of the # sign in <font color="
#FF0000">.  A Simple Bold tag could suit my needs too but <b> or 
<strong> tags seem to have no effect either.
-
-Is it even possible to format text inside a drop down menu?
-
-As always, thanks in advance!
-


----------
William E. Seiter
http://william.seiter.com
Web Developer

Have you ever read a book that changed your life? 
Go to: <a href="http://www. 
winninginthemargins.com">www.winninginthemargins.com</a>
Enter passkey: <strong>goldengrove</strong>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3119
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to