Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form - textarea element - dynamic content - color control 2

Status
Not open for further replies.

buddyholly

Programmer
Sep 12, 2002
24
FR
I need to change the color of the textarea element - which I populate dynamically via coldfusion. Not a problem if the menu items are static, but cant get if for dynamic situaion. Tried css stylesheet

TEXTAREA {

background-color:blue;
}

but that does not work.

Heres the code around the textarea element

<form name=&quot;form4&quot; method=&quot;post&quot; action=&quot;artistName2_action.cfm&quot;>
<select name=&quot;nom&quot; class=&quot;MENU&quot; size=&quot;10&quot; id=&quot;nom&quot;>
<!--- <option value=&quot;&quot;></option> --->
<cfoutput query=&quot;Recordset1&quot;>
<option value=&quot;#Recordset1.nom#&quot;>#Recordset1.nom# (#Recordset1.prenon#)</option>
</cfoutput>
</select>
<br>
<input type=&quot;submit&quot; name=&quot;Submit4&quot; value=&quot;Recherchez par Nom&quot;>
</form>

many tks for any help
 
Just figured this out so I'll answer my own question - maybe useful to someone

trick it to change the above code as follows - ie insert the STYLE=&quot;background:BEB3A7&quot; code into the <option> element - where BEB3A7 is the color needed. Note, does not work with #in front of color code

<cfoutput query=&quot;Recordset1&quot;>
<option STYLE=&quot;background:BEB3A7&quot; value=&quot;#Recordset1.nom#&quot;>#Recordset1.nom# (#Recordset1.prenon#)</option>
</cfoutput>
 
Just to clarify, you're not dealing with a TEXTAREA here, you're using select box options.

So this:

TEXTAREA {

background-color:blue;
}

isn't going to work because the TEXTAREA that is referenced does not exist in your form.

This is what you need for the slect box:

select {
background : blue;
}


But since you're already using class=&quot;MENU&quot; in the select box, you would either need to add the background color to that class or create another one for the select box. Or, you could just add the style to the option tag, which is what you did. :)

Hope This Helps!

Ecobb

&quot;Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.&quot; - Homer Simpson
 
You're using coldfusion so you need to escape the # with two # signs in the style, I don't think NS will see the color without a pound.

<cfoutput query=&quot;Recordset1&quot;>
<option STYLE=&quot;background:##BEB3A7&quot; value=&quot;#Recordset1.nom#&quot;>#Recordset1.nom# (#Recordset1.prenon#)</option>
</cfoutput>

thereptilian120x120.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top