Hello Everyone I’ve created a jsp page in which I created two drop down menus that are populated from database. When I test the page it works fine but my manager told me the fields in the drop down menu needs a background color like in the image below. what can i do to do that? If these fields were hard coded I knew how to do it but I don’t know how to do it in this scenario. My code is also on the bottom.. Thanks!
`<form:form method="POST" commandName="excsAnaSelNav">
<br>
<table width="100%">
<tr>
<td width="20%"></td>
<td width="20%"> Type:
<form:select id="type" onChange = 'checkType()'path="analysisEvents">
<form:option value="All" label="--- All ---" />
<form:options items="${analysisEvents}" />
</form:select>
</td>
<td width="20%"> Forecast ISC:<form:select path="iscCodes">
<form:option value="All" label="--- All ---" />
<form:options items="${iscCodes}" />
</form:select>
</td>
<td width="30%"><div id="sctry" style="visibility:hidden">
Actual ISC: <select style="width:50px" id="actualisc">
<option value="ALL" selected>All</option></select></div>`

You need either a table/column in your database which specifies the color to use with the corresponding entry, or an array in your script which references these things. When creating the DropDown, you would simply query your database/your array for the color corresponding to the entry which you put in your select box.
I’m no good with JSP, so here’s some pseudocode: