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/Text area - dynamic content - how to change color ? 3

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
 
buddyholly,

I assume you actually mean the SELECT element?

In which case, modify your style sheet to read:

Code:
SELECT { background-color:blue; }

Hope this helps!

Dan
 
many thanks Dan for the reply.
No, its the textarea element not the submit button. I think I have figured this out. The trick seems to be to insert STYLE=&quot;background:BEB3A7&quot; inside the code as below

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

However, it does not work if you use #BEB3A7 instead of BEB3A7 - the hash is taboo - beats me, but it works. For your intereset you can see the page at
I'm in the process of chaning it to beige from blue

many thanks, buddyholly
 
Looks like a SELECT box of size 10 to me. Or am I looking at the wrong area? [3eyes]

Pete.


Lotus Notes Web Developer / Aptrix (LWWCM) Consultant
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Nope - it's a SELECT. The code simply has no TEXTAREA anywhere in it.

I guess some people just can't be told ;o)

Dan
 

In which case the following will definately work:

Code:
<STYLE TYPE=&quot;text/css&quot;>
SELECT { background-color:blue; }
</STYLE>

Dan
 

In fact - that's identical to what I posted earlier.

Why do people poo-poo helpful posts without even trying them? If they know better, why do they ask here in the first place?

It gets to me sometimes - you go to the effort of helping someone, and they throw it back in your face without even trying it.

Sorry for the rant, but that's the 3rd time in 2 days that someone has done that to me.

Dan
 
Dan please accept my apologies, I was'nt trying to be a smart è-è-.
 
If you insist on calling selects &quot;textareas&quot;, you'll need to try this:
[tt]
<html>
<head>
<meta http-equiv=&quot;mind-reading-mode&quot; value=&quot;on&quot;>
<style>
textarea { background-color: blue }
</style>
</head>
<body>
<form action=&quot;/cgi-bin/myscript.pl&quot;>
<select>
<option>Look it's blue!</option>
</select>
</form>
</html>
[/tt]
Can't send hugs, how about a star?


-- Chris Hunt
 
Actually, buddyholly came up with the best answer on his own, if you look at the original post, the select box already has a class specified:

<select name=&quot;nom&quot; class=&quot;MENU&quot; size=&quot;10&quot; id=&quot;nom&quot;>

So just adding a SELECT statement to his style sheet wouldn't work. You would either need to:
1) Modify the specified CLASS to make the select do what you want.
OR
2) Add the desired Style to the select's &quot;option&quot; tags, which would not change the original CLASS and reduce the risk of &quot;breaking&quot; something.

But I see your point, BillyRay. buddyholly was insiting on fixing a TEXTAREA when there wasn't even one there. Paying attention to your original post should have pointed that out and fixed the problem for him.

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
 
Thanks again to everyone - I'm a bit new to this CSS stuff so forgive my confusion. I've learned a lot with this. Really appreciate your taking the time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top