| Author |
How to change color in the options using html:options
|
Senthil Mahalingam
Greenhorn
Joined: Jun 29, 2010
Posts: 3
|
|
Right now my code is like this ,
<html:select property="stdCode" value="" style="width=99%;">
<option value="">-- Choose an Option --</option>
<html:options collection="lspproval" property="code" labelProperty="name"/>
</html:select>
Just populating the dropdown using the collection.
Now i want to apply a red color for a particular option value.
( Assume the values in the list value is USA,Brazil,Italy now i have to apply green color to the USA option).
Any help ?
|
 |
Richard Golebiowski
Ranch Hand
Joined: May 05, 2010
Posts: 213
|
|
I think this belongs in the Struts forum.
Anyway, if you look at the generated HTML you will see a series of option tags. So what you need to do is set the background color for the desired option tag. You could do this by applying a style based on the tag id.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
Also, please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.
Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: How to change color in the options using html:options
|
|
|